I have a window with a single member controlset [textfield(0)]
the purpose is to dynamically add and position more textfields as the app requires at runtime.
This all works fine… EXCEPT if I try to create a CONSTRUCTOR that passes a value
this works
dim temp as new myTextfield
temp.caption = "something"
this does not [the control never appears]
dim temp as new myTextField("something")
// where the constructor contains [me.caption=value, and value is an argument of the constructor]
am I doing something “wrong”? or is this a bug {API1.0}
To be able to put them in a layout at design time they require a no param constructor
But, like youre trying, its useful to want to have a a parameterized constructor
have a read of that article which may give you some insight into how to make this work better
My guess is that in your constructor the caption parameter is getting set before the field itself is completely built. Can you set a local property, say ‘mCaption’, to the parameter and then assign mCaption to the Caption in the Open (Opening ) event handler?
I just made it simple… I added the one parameter as public (I wanted it private, which could have been handled by the constructor)… then just set it after I instantiated the control
The stuff in Norms post (thanks) was too much to duplicate for 12 different subclassed control types