Solved

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

Posted on 2006-11-30
3
224 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 85

Accepted Solution

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

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

Assisted Solution

by:Hillwaaa
Hillwaaa earned 200 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

821 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