designer doesn't add code to initializecomponent

  • Thread starter Thread starter Franz
  • Start date Start date
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.)
 
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?
 
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();
}
}
 
Back
Top