Solved

VB.Net Anchor Layout

Posted on 2003-12-09
2
1,410 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
Comment Utility
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
Comment Utility
You could manually align them with something like:

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Normally the drop down box control found in the .Net framework tools is able to select just one data and value at a time, which is displayed on the text area.   But what if you want to have multiple values to be selected in the drop down box? As …
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This video discusses moving either the default database or any database to a new volume.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

728 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now