473,395 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Programatically positioning control on form

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!
Aug 26 '05 #1
2 2761
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]
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:12**********************************@microsof t.com...
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!

Aug 29 '05 #2
That helps me get the control positioned in the top, left of the form, but
what about positioning the control elsewhere in the frame? Am I stuck with
fiddling with coordinate math?

"Mona" wrote:
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]
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:12**********************************@microsof t.com...
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!


Aug 30 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Dave Bootsma | last post by:
Is it possible to programatically save a certain image from a certain web page? I want to automatically get a specific graphic from a specific web page programatically so I can automate the...
1
by: Tim Pacl | last post by:
I am building a custom server control. I need to determine whether the page the custom control resides in is in flow layout or grid layout. Because I am doing this from the server control, I need...
4
by: Andrea Williams | last post by:
Does anyone know of some in depth documentation regarding how to add user controls programatically? I have a User Control, which has some basic html controls, and depending on the number selected...
3
by: desmcc | last post by:
I know how to programatically add a text field to a web page. What I don't know is how to adjust the position of any controls below the one I am adding. (The page layout is grid layout). There...
2
by: hzgt9b | last post by:
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,...
3
by: Pete | last post by:
Using C# and a web browser control, is there a way to programatically click a web page button?
0
by: mike | last post by:
Hi, When I programatically Bind a DataSource to DetailsView it does not fire "ModeChanged" event. This is first time i am trying to use ASP.NET DetailsView control. I have played with some of the...
1
by: Hamed | last post by:
Hello I have a question about CHILD forms in an MDI form. How can I have a neat positioning of child windows in an MDI form? When I open a new child window in my MDI form it is opened in a...
7
by: The Mad Ape | last post by:
Hi I have code to programatically create a label. It works but when I try to call a sub to create a tooltip it does not work. I do not get an error so have no idea what it wrong. Please review...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.