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

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
DeniseGoodheartAsked:
Who is Participating?
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
Try...

    Me.btnEnter.Location = New Point(429, 17)
0
 
HillwaaaConnect With a Mentor Commented:
Hi DeniseGoodheart,

Use:

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

Assuming your x and y work from the top left?

Cheers,
Hillwaaa
0
 
DeniseGoodheartAuthor Commented:
Thanks Idle Mind and Hillwaaa.  They both work great!

Cheers,
Denise
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.