Solved

VB.Net Anchor Layout

Posted on 2003-12-09
2
1,419 Views
Last Modified: 2012-06-21
Hi,
I have textboxes with labels above them on a panel.  When I install an run the program on a different computer with different resolution, the labels and textboxes no longer are aligned. (They were previously aligned both to the left with the label above the textbox.

Any Ideas what is going on?  Think I have tried every combination of anchoring?

Thanks
0
Comment
Question by:sublimation
2 Comments
 
LVL 1

Accepted Solution

by:
dwops earned 250 total points
ID: 9905430
what anchoring does is it maintains the distance between the edge of the control and the edge of the form.  if its anchored to the left and the right, then the control's width will stretch (or contract) to maintain that distance.  If you don't want your control to change width, then don't anchor then to BOTH edges.  

For example if you want your control to be the upper left corner, then anchor them to the top and to the left.  I would recommend this for you.  I you don't want it to align to the left part of the screen, then remove both the left and right anchors, this will allow the  control to maintain its position and not move with the size of the form.

this article covers it pretty well
http://www.imt.net/~joe/matt/program/vb/Tutorials/pflvb7/
0
 

Expert Comment

by:durkin
ID: 9907961
You could manually align them with something like:

Textbox1.Left = Label1.Left
Textbox1.Top = Label1.Top + Label1.Height
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question