Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-14-2005, 10:35 AM   #1
Registered: May 2005
Posts: 275

Rep: Reputation: 30
command to resize forms contents when form is resized

Can anybody offer me some help on the command that will resize all of the forms contents when the form is resized. I am having this problem when my program goes on other pc's with bigger monitors. The form will resize and leave alot of blank space instead of the buttons, text boxes, listboxes, etc resizing aswell.
Old 07-14-2005, 10:39 AM   #2
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
I think I answered this in your other thread already. Did my solution not work? Or did you not understand it?

Anyway, once again... Each of the .Net controls has an Anchor property that you can use to anchor it to the left, right, top, and bottom of the parent control or window.

So for instance if you take a multiline text box, anchor it to all sides of the window, as you size the window, the size of the text box will follow the size of the window...

You may have to play with the exact anchors you want to get the desired effect, but that's easy enough to do.

Edit: Just in case you can't find the property in the VB .Net form designer, here's the code that the form designer generates to set the Anchor property to be left, right, top, and bottom. Remove the ones you don't want anchored to get the effect you want:

        Me.TextBox1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                    Or System.Windows.Forms.AnchorStyles.Left) _
                    Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
*shiver* I can't believe I'm actually posting VB code. I feel so dirty...

Last edited by deiussum; 07-14-2005 at 10:46 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing form values between multiple forms!! AskMe Programming 5 09-07-2005 07:44 PM
Running a foctorylink webclient from a form mrobertson Programming 0 07-18-2005 09:17 AM
sizing a form in mrobertson Programming 3 07-13-2005 07:04 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 10:27 AM
how do I copy a whoel folder form one directory to another form the command line? zwyrbla Linux - Newbie 8 08-24-2004 06:40 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration