Jump to content
Xtreme .Net Talk

Recommended Posts

Posted
I have a form that has text boxes on it and labels that I would like to resize, but when they are resized I need the other boxes to move down so that they can be seen. I know that I can manually do this by using Location=new Point(); but that will take a long time. Is there an easier way?
C#
Posted
Create a panel to contain all the textboxes that you want to align together. Set each of them to Dock = Top and as you resize each, the ones below will move accordingly. You can then do the same thing with the labels which will go into another panel to the left of the first.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

You are right Derek, I am moving the other boxes down when one above it is resized because if they did not move then the user could not see the boxes under it.

 

So, I have to do it manually in that case?

 

And, it is awkward to do it the way I am? It seems reasonable to me? I would think alot of people would do it this way. But what do I know, I just started.

C#
  • *Gurus*
Posted

You should take a shot at the method TechnoTone mentioned above, before you go ahead with doing it manually.

 

But yes, what you're doing is beyond the ordinary. I'd strongly suggest organizing your data input methodology differently, either using a tabbed dialog control or a ListBox menu/panel system. Nowhere in a professionally designed business application will you see TextBoxes doing what you're having them do. It's fine, and it might work for you, but it is not the standard.

Posted (edited)

Why don't you just add a splitter bar between each textbox, or the panels TT suggested? This will handle to resizing for you. (Set the dock style of the splitter also to top)

 

EDIT: To clarify - use a panel to hold a label and textbox. Dock the label to left and the textbox to fill. Add this panel (which dock is set to top) to your container and add a splitter afterwards (dock set to top). Note that you will have to add these controls in reverse order to what you want to see on the screen..

Edited by Cywizz
Howzit??
Posted
You are right Derek, I am moving the other boxes down when one above it is resized because if they did not move then the user could not see the boxes under it.

That's exactly what I thought - and that's exactly what I described with the panels.

 

I have attached a form demonstrating what I mean:

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

Oops! I'm sure I attached it last time.

 

Edit: I've figured out what went wrong with my attachment. When you preview a message the attachement dissapears!

resizeexample.zip

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...