LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 07-14-2005, 11:35 AM   #1
mrobertson
Member
 
Registered: May 2005
Posts: 275

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


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, 11:39 AM   #2
deiussum
Member
 
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:

Code:
        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 11:46 AM.
 
  


Reply


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 08:44 PM
Running a foctorylink webclient from a vb.net form mrobertson Programming 0 07-18-2005 10:17 AM
sizing a form in vb.net mrobertson Programming 3 07-13-2005 08:04 AM
shell script works form command line but not form crontab saifee General 1 10-14-2004 11: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 07:40 PM


All times are GMT -5. The time now is 09:35 AM.

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