Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Moving controls in code

Status
Not open for further replies.

jambu

Programmer
Nov 20, 2002
185
GB
I have a number of dropdown lists and make some visible and others invisible depending on what the user selects in another list. This works fine but it looks untidy as there is a gap where the invisible lists are.

Back in vb6 I would be able to move the visible controls up to leave no gaps and now I want to do the same in ASP.NET (VB.NET). There are several mentions on this forum of using flowcontrol and deleting the "Position: Absolute;" from html but I can't find anything about what to do next.

Having done the above should I be seeing top and left properties for these controls?

Can anyone explain the steps necessary to move controls in code?

Thanks in advance.
 
Thanks DotNetGnat, I should have pointed out that I had tried changing this before but it doesn't seem to let me move controls around.

What I want to do is something like ...

ControlName.Top=100
ControlName.Left=50

Is this what I should be able to do?
 
You can only do that if your page uses absolute positioning (which is what GridLayour forces) however there are very few times when this should be used and it isn't recommended.

Unfortunately, you've got quite a bit of reading to do as you'll have to understand HTML and CSS in order to layour your page correctly. I suggest starting here:





____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.
 
Thanks for the feedback but I think I have a simpler "kludge" of a solution.

I am simply going to make the top 'n' lists and labels visible and fill them with whatever I need.
 
OK, but I'd still suggest learning HTML and CSS as if you are going to be doing any kind of web development, using absolute positioning will cause lots of problems unless you know exactly who your users are and how they will be accessing your site.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
Thanks ca8msm, I am in a hurry on this one but I will look into the links you posted later.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top