Re: Where does the designer code come from?



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

  • TreeView Mouse event behaviour puzzles
    ... I am looking to implement drag & drop in a TreeView control. ... I changed to the MouseDown/MouseMove/MouseUp approach the MouseDown/MouseUp ... ...Numerous MouseMove events occur in succession here ...
    (microsoft.public.dotnet.general)
  • Re: What do I call what I want to do?
    ... Inherit the class from System.Windows.Forms.CommonDialog. ... and you can drag it onto your project (it ... it doesn't work - it looks for a dll and can't find it. ... A control is a class. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Drag n drop function for form memo field
    ... Not sure why you can't edit text in the rich text control, ... >> Active X control to get Drag Drop capability. ... >> provide to install your application. ...
    (microsoft.public.access.formscoding)
  • Re: Application Starting Point
    ... Thanks for the info Kevin. ... on the control, I can no longer drag my control around the form. ... graphical representation of boxes on a shelf. ...
    (microsoft.public.dotnet.general)
  • Re: Prevent UserControl derivative from being designed
    ... just alter the source to suit his needs. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... I don't want them to design the base ... > and then select the control in the Inheritance Picker, ...
    (microsoft.public.dotnet.languages.csharp)