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: 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: 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: 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)