How to set text property of a ComponentControl
-
Hi! i have made a component control and its inherited from System.Windows.Forms.Button class. now when i go to the designer and set the text property, i am unable to set the text property. when i set the text property and use this control on the form, that text setting is not coming. please let me know how can i get this resolution. Thanks!
-
Hi! i have made a component control and its inherited from System.Windows.Forms.Button class. now when i go to the designer and set the text property, i am unable to set the text property. when i set the text property and use this control on the form, that text setting is not coming. please let me know how can i get this resolution. Thanks!
Without seeing your code, it's impossible to say what you did wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Without seeing your code, it's impossible to say what you did wrong.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
i did not code anything. i have just created a component class and then went to designer partial class code and inherits it from the button class. that's it and then went to designer and tried to set the property from the property window.
How about this. Scrap the component you have and just add a new Class file to the project. Open that file up and replace anything you see in it with this:
Public Class MyButton Inherits System.Windows.Forms.Button End Class
Compile that, then drag one of these from the ToolBox to your form, then try and set the Text property.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
How about this. Scrap the component you have and just add a new Class file to the project. Open that file up and replace anything you see in it with this:
Public Class MyButton Inherits System.Windows.Forms.Button End Class
Compile that, then drag one of these from the ToolBox to your form, then try and set the Text property.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008hm that the way i have done too. the name of the control was "ASKButton" i have set the text property to "Add" then compile the project and drag drop the button control on the form and what i see is that the button text property is "ASkButton1". i want to set the default value for this button. when ever i drag and drop this button it should show me the Text=Add and when i want to change it, it should allow me to do so!