designer doesn't add code to initializecomponent

F

Franz

UserControl has overrided the Text property. I can't view it in the
designer. I subclass it and set the Browsable attribute to true. I can see
the Text property now. Although the text becomes bold everytime I modified
it, no code is added to InitializeComponent. What is the problem? Why no
code is generated? What kind of attribute do I need to add?
(I have also added
[Designer("System.Windows.Forms.Design.ParentControlDesigner,
System.Design", typeof(IDesigner))] at the beginning of the subclass of
UserControl.)
 
J

John Saunders

Franz said:
solved
thanks anyway :)

Franz said:
UserControl has overrided the Text property. I can't view it in the
designer. I subclass it and set the Browsable attribute to true. I can see
the Text property now. Although the text becomes bold everytime I modified
it, no code is added to InitializeComponent. What is the problem? Why no
code is generated? What kind of attribute do I need to add?
(I have also added
[Designer("System.Windows.Forms.Design.ParentControlDesigner,
System.Design", typeof(IDesigner))] at the beginning of the subclass of
UserControl.)


What was the solution?
 
F

Franz

John Saunders said:
Franz said:
solved
thanks anyway :)

Franz said:
UserControl has overrided the Text property. I can't view it in the
designer. I subclass it and set the Browsable attribute to true. I can see
the Text property now. Although the text becomes bold everytime I modified
it, no code is added to InitializeComponent. What is the problem? Why no
code is generated? What kind of attribute do I need to add?
(I have also added
[Designer("System.Windows.Forms.Design.ParentControlDesigner,
System.Design", typeof(IDesigner))] at the beginning of the subclass of
UserControl.)


What was the solution?

Sorry, I forget to post out the solution.

[Browsable(true), DefaultValue(""),
DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public new string Text {
get { return base.Text; }
set {
base.Text = value;
Foo();
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top