Solved

VB.Net Anchor Layout

Posted on 2003-12-09
2
1,421 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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