Programatically positioning control on form

G

Guest

Using Visual studio 2003 and VB.NET, I want to programatically position a
control (windows media player) on my form. For example, I want to position
the control in 1 of 9 locations: topLeft, topCenter, topRIght, leftCenter,
center, rightCenter, bottomLeft, bottomCenter, bottomRight.

Is there an easy way to ask the container to place the control in one of
these places? I assume I can do coordinate math - getting bounds from the
form but I was hoping to avoid that.

After placing the control on the form, I know that I'll need to set its
anchor property so that it can keep its relative position. Is there something
slick that I can do with the Dock property?

Any help would greatly be appreciated!
 
M

Mona

Hi,
How are you doing?
To achieve this try using the top, left property of the Control(media
player)

You may place this control based on the container form's top left, height
and width.

Me.Button5.Top = Me.Top
Me.Button5.Left = Me.Left

I hope this is helpful.


Thanks
Mona
[Grapecity]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top