[RESOLVED] Get the Code that Makes the GUI
I just tried fooling around with a "windows forms" project, and I would like to see the code that creates the form. How would I go about looking at that?
I can only edit the code that would occur from GUI events.
EDIT: to clarify I am talking about the code that says "make the window these dimensions, make a button and put it here, make a textarea and put it here, etc)
Re: Get the Code that Makes the GUI
in the solution/project explorer, there's a toolbar button "Show All Files" .. .turn it on... if you then look at your form, you should see a "+" next to it, showing there's files under it... expand it... what you're looking for the is the .designer file.... but be careful... changes in there can destroy your form, making it unusable (if you don't know what you're doing... and even in some cases when you do know what you're doing) ...
-tg
Re: Get the Code that Makes the GUI
There are two files associated with each form (actually three, but you can ignore the third). Normally, you see just the .VB file, which is your event handlers. However, there is also a .designer.vb file which can be found by clicking the ShowAllFiles icon at the top of the solution explorer window. That is where the code that creates and positions all the controls is located.
Re: Get the Code that Makes the GUI
TG is right about editing that file. Changes can do bad things, such as making the form unopenable, and even crashing VS. However, it isn't magic. The objects follow the same rules as any other code. The control is declared in one section, created in a different section, a bunch of properties are set in yet another section, then the control is added to a controls collection near the end.
Re: Get the Code that Makes the GUI
Thanks guys, I just want to share the code with my friend, so I need to be able to copy it.