Changing the order of controls in "Windows Form Designer generated code"

  • Thread starter Thread starter MadMikey
  • Start date Start date
M

MadMikey

Can I change the order that controls are defined, or built, in the "Windows
Form Designer generated code" section?

I'm using VB.NET 2003. I have a custom control, that due to licensing
restrictions, it must be defined before another "container" control on my
form. I can manually move the code to where I need it, and successfully
build my project. But whenever I modify the form, VB rearranges the Windows
Form Designer code. I am growing weary of moving that particular block of
code each time I build my project.

Any ideas?

Mikey
 
Dont try to change the code in "Winform designer generated code" region.

1) Put your specific control loading code in the order you want it, in a new procedure
2) call that new proc from you InitializeComponent() OR call it before/after call to InitializeComponent()

HTH
Kalpesh
 
* "MadMikey said:
Can I change the order that controls are defined, or built, in the "Windows
Form Designer generated code" section?

I'm using VB.NET 2003. I have a custom control, that due to licensing
restrictions, it must be defined before another "container" control on my
form. I can manually move the code to where I need it, and successfully
build my project. But whenever I modify the form, VB rearranges the Windows
Form Designer code. I am growing weary of moving that particular block of
code each time I build my project.

You can add the control outside the designer generated code, for example
before the call to 'InitializeComponent'. Notice that this will maybe
break full compatibility with the designer.
 
Back
Top