Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How To Place A Command Button At X and Y Location Using Code

Posted on 2006-11-30
3
Medium Priority
?
242 Views
Last Modified: 2010-04-23
Hi,

I’m using VS.NET 2005.  I have a command button called btnEnter.  I need to place the btnEnter at different x and y form locations based on certain events.  How would I write this in code?  I would like the button to be at the following location:

X=429
Y=17

The following code did not work:

Me.btnEnter.Location.X = "429"
Me.btnEnter.Location.Y=”17

Thanks,
Denise
0
Comment
Question by:DeniseGoodheart
3 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1200 total points
ID: 18049711
Try...

    Me.btnEnter.Location = New Point(429, 17)
0
 
LVL 16

Assisted Solution

by:Hillwaaa
Hillwaaa earned 800 total points
ID: 18049712
Hi DeniseGoodheart,

Use:

        Me.btnEnter.Top = 17
        Me.btnEnter.Left = 429

Assuming your x and y work from the top left?

Cheers,
Hillwaaa
0
 

Author Comment

by:DeniseGoodheart
ID: 18049855
Thanks Idle Mind and Hillwaaa.  They both work great!

Cheers,
Denise
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…

877 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