Re: Windows form designer generated code being misplaced

Tech-Archive recommends: Speed Up your PC by fixing your registry



Are you using .Net 1.1 or .Net 2.0 or above? IIRC, .Net 1.1 put all of the code in the main form. I use VS2005. I inherited a project that was .Net 1.1, and I converted it, but it still has the code in the main form rather than a designer file; I'd have to move it myself. I've never seen VS2005 or VS2008 randomly put code-behind designer code in the main form.

Can you give an example of what you're talking about being included in the main form that you think should be in the designer.vb file?

RobinS.
GoldMail, Inc.
--------------------------------------
"BobRoyAce" <broy@xxxxxxxxxxxxxxxxxxxx> wrote in message news:8f2f3680-c339-4aa4-899d-55cc6b7b0499@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Let's say that I have a form, called Form1. It could have three files
associated with it, which I have listed below together with my
understanding of what "should" be in each:
Form1.vb -- should contain any custom code I've written for the
form
Form1.Designer.vb -- should contain all windows form designer
generated code
Form1.resx -- should contain any resources associated with the
form

I have two questions.

First, why do I sometimes end up without the Form1.Designer.vb file,
where all windows form designer generated code is put into the
Form1.vb file?

Second, why, in cases where I do have the Form1.Designer.vb file, does
a bunch of windows form designer generated code get put into the
Form1.vb file anyway? These would be lines like:

Friend WithEvents spinedNumberOfLocations As
DevExpress.XtraEditors.SpinEdit

I really would like to keep the Designer code in the *.Designer.vb
files always and would like to understand why this is happening.

.



Relevant Pages

  • Re: Doing Time in the "Windows Form Designer generated code" region
    ... Hi John, ... I would like to confirm my understanding of your issue. ... to write code in "Windows Form Designer generated code" region. ... the form constructor like "public Form1", ...
    (microsoft.public.dotnet.framework.adonet)
  • Windows form designer generated code being misplaced
    ... Let's say that I have a form, called Form1. ... understanding of what "should" be in each: ... Form1.Designer.vb -- should contain all windows form designer ... Friend WithEvents spinedNumberOfLocations As ...
    (microsoft.public.dotnet.framework.windowsforms)