trouble with win forms

G

Guest

i have a lot of forms, they all inherit some basic template form, and after
that some more controls are added. there is a panel with buttons and tab
control with two tabs. now when i open that form i visual studio everything
becomes a mess: almost everything gets a wrong location, tabcontrol and panel
get a size thats way beyond the form and so on. also, a lot of docks become
troublesome.

how do i make these forms behave nicely in vs and how to work with them etc.
add new controls, rearrange and so on (visually)

nedim
 
A

AlexS

Check Resize event for form.
You can recalculate positions for all your controls if standard Dock and
Anchor properties don't work for you

HTH
Alex
 
G

Guest

the problem is when i open the form in vs it gets destroyed, so adding
another control such as a label or a textbox or a button is all but
impossible.

i tried writing a function that sets the values of all controls and run that
function on load event but it doesnt really work
 
M

Morten Wennevik

Hi Nedim,

I think there is a bug in the VS.Net 2003 designer that will mess up the controls. I once created a a whole bunch of custom controls in a neat gridlike structure, but somewhat later the designer decided to move a single one of the controls to the upper left corner. However, as long as I didn't do anything in the designer the program would compile and show the controls in the correct positions anyway. Changing anything in the designer would probably store the oddities as well.

Not sure why the designer sometimes behaves this way, or how to prevent it doing so. If nothing works, try creating a new project and copy/paste the entire code files.
 
G

Guest

could i maybe use other ide like sharpdevelop or borland to design the forms
and use vs only for code editing and compiling, would that work?
 
A

AlexS

SharDevelop uses MS designer component, so sometimes it behaves in similar
way - behavior and layout of controls during run-time and during design is
different.

I suggested Resize because you can create initial design with VS and do the
rest of layout at run-time. Like resizing controls, repositioning them etc.
Just don't re-design in VS. Or ignore re-positioning of controls in VS when
re-designing - anyway, Resize code will put controls back in place. It's a
pain in the brain sometimes, but guarantees that you get what you want.

Did not try Borland though. However, if they use same designer as MS, I
would expect same troubles.

HTH
Alex

Nedim said:
could i maybe use other ide like sharpdevelop or borland to design the forms
and use vs only for code editing and compiling, would that work?
controls. I once created a a whole bunch of custom controls in a neat
gridlike structure, but somewhat later the designer decided to move a single
one of the controls to the upper left corner. However, as long as I didn't
do anything in the designer the program would compile and show the controls
in the correct positions anyway. Changing anything in the designer would
probably store the oddities as well.it doing so. If nothing works, try creating a new project and copy/paste
the entire code files.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top