I decided to have it a go...but stopped right in the 1st line of code...
Im trying to create a custom control using Shap-Develop...
So I create the graphical control and now must do the code...
1st- what is the constructer syntax like?
I have ..
mycontrol obj = new mycontrol
Is this correct?
I2nd- Now I need to accept some args, 4 Strings and 1 Image name, how do I implement this?
Thanks guys....
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
After beeing stuck for most of the afternoon, i decided to re-install vs2005 and try in it to build my dll....
As before designing the control grafic is easy but the rest...
HELP!!!
OK, putting it simple....
I'm trying to build a 4 Label, 1 image user control, wich args will only be the text for the labels and the image file name, all other props are locked....
please help...I don't want anyone doing it for me, I want to understand what i'm doing....
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
This may help. It is the simplest possible C# dll that displays and undisplays the wait cursor.
Note that the constructor is a function with the same name as the class. This constructor is a do nothing constructor as no initialisation is needed.
Quote:
Now I need to accept some args, 4 Strings and 1 Image name, how do I implement this
Replace the existing constructor (or add another) such as
Public myclassname(string s1, string s2, string s3, string s4, string image)
{
// do your initialisation
}
You can add as many constuctors as you want as long as their argument lists are different. The first constructor will be New1 in B4PPC, the next New2 and so on. For example
Public myclassname(string s1, string s2, string s3, string image)
{
// do your initialisation including setting s4 to some default or null
}
Do i need to declare the args before the constructer? If so where?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Do i need to declare the args before the constructer? If so where?
No. They ARE being delared in the constructor argument list, you merely need to use their values in your initialisation code or store them in private local variables before the constructor returns or they are lost.
Do i need to worry about the font setting in the control properties?
And one last but perhaps the more inportant to me...
I'm also ading a button to the control...(It's an About Panel) shhh.....how do I implement dispose with the button click event?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
This superb utility lets you examine almost all of the .NET Framework in the language of your choice, VB.NET, C# Delphi etc. and see how Microsoft has coded it. You can also look inside the B4PPC dlls and other .NET exes to see how they are built and what they do. Download it and in case it is not obvious press the spacebar or invoke Tools -> Disassemble to see the code for the selected assembly. There are various add-ons, of variable quality, available via a link on the download page. I like FileGenerator which will produce a VS 2005 project file set, although actually getting it to compile without errors may be a battle!
Do i need to worry about the font setting in the control properties?
I don't know what control you are using but I would try it and see. I think most of the existing controls come with a default font already set.
Quote:
Originally Posted by Cableguy
I'm also ading a button to the control...(It's an About Panel) shhh.....how do I implement dispose with the button click event?
I'm not sure what you mean but normally in .NET code you don't need to ever implement a disposal function as the .NET Garbage Collector will remove an object when there are no further references to it. Disposal is normally only needed when your code has acquired resources from outside .NET (like mallocing memory or interacting with non-managed dlls) that need to be explicitly freed. Doing this is unsafe code that should be avoided if at all possible as you are then losing the safe coding advantages of the .NET Framwork.
Calling the control will pop-up( eventaully) a Panel containing the refered fields and, beiing all of them just output fields, i need to implement a way of hidding/disposing the control...that's why I added the button, but how to implement the Hide or, preferably, the dispose upon button click?
BTW-Thanks for the link, great tool...
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!
Ok, I'm/was getting confused with the amount of files created with the basic project, but i'm starting to get a hold of things...
So I implemented 1 constructer and 1 method(?) called DLLVersion...Anad build the solution....
I tryed it out and it works....well...sort of...my constructor is there and my method along with a LOT of other things that I dont know what they are, and that i didn't create....What am i doing wrong?
__________________
Paulo Gomes - Porto, Portugal - Living/Working in France
Mobile Device: Samsung Galaxy S, Android 2.3.4 CUstom ROM
Laptop: Toshiba NB100-130 (running on Win7Ultimate)
My Posts helped you? Consider Buying me a Porto Glass!