Solved

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

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now