Solved

VB.Net Anchor Layout

Posted on 2003-12-09
2
1,424 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

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…
A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

751 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