PC Review


Reply
Thread Tools Rate Thread

designer doesn't add code to initializecomponent

 
 
Franz
Guest
Posts: n/a
 
      3rd Jul 2004
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.)


 
Reply With Quote
 
 
 
 
Franz
Guest
Posts: n/a
 
      3rd Jul 2004
solved
thanks anyway :-)

"Franz" <(E-Mail Removed)> 在郵件
news:%23NqV$(E-Mail Removed) 中撰寫...
> 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.)
>
>



 
Reply With Quote
 
John Saunders
Guest
Posts: n/a
 
      3rd Jul 2004
"Franz" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> solved
> thanks anyway :-)
>
> "Franz" <(E-Mail Removed)> 在郵件
> news:%23NqV$(E-Mail Removed) 中撰寫...
> > 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
johnwsaundersiii at hotmail


 
Reply With Quote
 
Franz
Guest
Posts: n/a
 
      3rd Jul 2004
"John Saunders" <(E-Mail Removed)> 在郵件
news:(E-Mail Removed) 中撰寫...
> "Franz" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > solved
> > thanks anyway :-)
> >
> > "Franz" <(E-Mail Removed)> 在郵件
> > news:%23NqV$(E-Mail Removed) 中撰寫...
> > > 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();
}
}


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Visual Studio DataSet designer doesn't regenerate designer.cs code Barney Microsoft C# .NET 3 15th Oct 2007 04:15 PM
modify designer generated c'tor that calls InitializeComponent? Zytan Microsoft C# .NET 2 2nd Mar 2007 07:11 PM
How to prevent the designer to create a value for a property in InitializeComponent ? Sagaert Johan Microsoft C# .NET 1 21st Oct 2006 11:30 AM
user control, which way is better and How InitializeComponent() {} is generated? What to do if I need change code in InitializeComponent(){}? Ryan Liu Microsoft C# .NET 0 14th Nov 2004 03:19 PM
user control, which way is better and How InitializeComponent() {} is generated? What to do if I need change code in InitializeComponent(){}? Ryan Liu Microsoft Dot NET 0 14th Nov 2004 03:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:20 AM.