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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programatically set listbox position 1

Status
Not open for further replies.

ZOR

Technical User
Jan 30, 2002
2,963
GB
I am trying to get access to a listbox in design view but move its position when its displayed. Any advice how to do it as it seems to be a hit and miss job setting its top and height properties in code.
 
Howdy ZOR . . .

Just set the [blue]Top[/blue] & [blue]Left[/blue] properties of the listbox. From VBA the units are in [blue]twips[/blue].
1 inch = 1440 twips
Also the position is relative to the top left of the section where it resides which is 0,0 (x,y). Increasing units move down or to the right.


Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Thanks. I was setting the top and left positions forgetting the listbox already had a start position. I then went to using

Me.List173.Top = Me.List173.Top - 1150
Me.List173.Height = 1250

Used it in the form load. However how do you set x,y co-ordinates, is this a move command (have never used move so guessing). Regards
 
ZOR . . .

Sorry about the confusion. I quoted x, y just to be explicit of the axes.

[blue]Left[/blue] is the x axis.
[blue]Top[/blue] is the y axis.

According to your post, you've moved the listbox 0.79 inches left of its current position, and set its height to 0.87 inches.

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Many thanks for comming back on that. All okay, thanks again. Have a star to keep you up there. Regards
 
ZOR . . .

These properties should exist for [blue]any control on a form![/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top