Re: Where does the designer code come from?



Thanks, that's what I was looking for. Looking to improve the designer code
for my components.

Schneider


"Sigurbjörn Valdimarsson" <sigurbj@xxxxxxxxxxx> wrote in message
news:OvWQZ25%23HHA.600@xxxxxxxxxxxxxxxxxxxxxxx
You might want to look at CodeDomSerializer and the
DesignerSerializerAttribute.


"schneider" <eschneider@xxxxxxxxxxxxx> wrote in message
news:u4jLI2ByHHA.3564@xxxxxxxxxxxxxxxxxxxxxxx
Yes, I guess I should have said "What .NET objects are used to generate
the code?" I want to alter the behavior.

Thanks,
Schneider


"OD" <webmaster @ e-naxos dot com> wrote in message
news:mn.7b647d77437ca577.18651@xxxxxxxxxxxxxxxx
How does the designer determine what code is used in the form designer
code?
For example 1, when you drag a control (using the object name?):
private System.Windows.Forms.TextBox txtUserName;
this.txtUserName = new System.Windows.Forms.TextBox();

When you drag a component onto the designer surface, VS is knowing the
class, then using reflection, it can get the list of public properties
and events. As all components must implement IComponent (providing
functionnality required by all components) and must inherit from
Control, it is easy to generate the "new" code and to manage other
common component behaviors.

Nothing really magic, just object programming :-)

--


OD___
www.e-naxos.com








.



Relevant Pages

  • Re: vs 2008 - designer no positioning
    ... Now I have to click outside of the control then click it again and drag it. ... The designer adds and edits a style for that object's position. ... All I'm doing is selecting new item and then ASP .net page. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: PDA application development
    ... Chris Tacke, Embedded MVP ... To get it to even work at all - not considering designer support ... write a COM interop wrapper around the control. ... "Michael Salamone" wrote: ...
    (microsoft.public.pocketpc.developer)
  • Re: Disappearing Controls when the designer loads a form.
    ... which were traced to an exception my user control threw while in the designer. ... private ArrayList readOnlyColumnsList; ... public string ReadOnlyColumns ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)
  • Re: Region property and applying it in a control
    ... > my region, but when the user resizes the control, the image does not match ... >> Bob Powell ... >> // This call is required by the Windows.Forms Form Designer. ... >> protected override void OnPaintBackground ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Composite Control Issue
    ... A derived control inherits the designer from its base control, ... the derived ListView control still has the same designer support in Visual ... which means the DerivedListView has the same designer as the ...
    (microsoft.public.dotnet.framework.windowsforms.designtime)

Loading