How to connect variable to generated control ?
-
I visually generated control, variable in code appears. But I have class derived from that type, (extend functionality to reuse), by which I want to handle visual part, I change type to derived, ... but editor not see precise type and removes control from the form. So, How to connect variable to control in such case ? Thanks
-
I visually generated control, variable in code appears. But I have class derived from that type, (extend functionality to reuse), by which I want to handle visual part, I change type to derived, ... but editor not see precise type and removes control from the form. So, How to connect variable to control in such case ? Thanks
I'm not sure I understand you (your question is very difficult to read, you might try elaborating a bit), but if you want to change the Type in your container (
Form
,UserControl
, whatever), then make sure both the variable type declaration and the instantiated Type (in theInitializeComponent
method) are the same, derived Type. Also make sure that that Type has been compiled and is either in the same project or a dependency project that has been referenced by your current project (when you right-click on the project and select Add Reference, select the project tab and add the project to make sure that a build dependency is established and that the build configuration (i.e., release, debug, whatever)is always in sync).Microsoft MVP, Visual C# My Articles
-
I visually generated control, variable in code appears. But I have class derived from that type, (extend functionality to reuse), by which I want to handle visual part, I change type to derived, ... but editor not see precise type and removes control from the form. So, How to connect variable to control in such case ? Thanks
??????????????????????????????????????????? This doesn't make any sense what-so-ever... Are you saying that you created your own UserControl class, inheriting from an existing control? Did you drop YOUR control on the form, or drop the base control that you inherited from? If you want to use YOUR version of the control, you'll have to add it to the Toolbox, then drag that onto your form, not the control you inherited from. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
??????????????????????????????????????????? This doesn't make any sense what-so-ever... Are you saying that you created your own UserControl class, inheriting from an existing control? Did you drop YOUR control on the form, or drop the base control that you inherited from? If you want to use YOUR version of the control, you'll have to add it to the Toolbox, then drag that onto your form, not the control you inherited from. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
Witout new control creation - in a visual way, I can not do it programmatically - to just add some small functions, in inherited class? but continue to edit all other properties - visually. (control disappear from editor) As extending Buttton in other languages, pure programmatically ?
-
Witout new control creation - in a visual way, I can not do it programmatically - to just add some small functions, in inherited class? but continue to edit all other properties - visually. (control disappear from editor) As extending Buttton in other languages, pure programmatically ?
What your saying is VERY difficult to understand. Are you saying that you want to set the properties of a control in a Properties Page like Visual Studio has in the bottom right corner of the screen? Is this control one that you wrote? Are you trying to write your own extended Button class and have your extended properties show up in the Property Page? RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome