[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Windows Positioning

Posted on 2005-05-12
4
Medium Priority
?
175 Views
Last Modified: 2010-04-23
I need to add a button to a WinForm in VB.NET 2003 so that when the user clicks it at any time, that window will be centered on the screen.

Any ideas?
0
Comment
Question by:SETP
  • 2
  • 2
4 Comments
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 2000 total points
ID: 13984682
on the button click just write this

CenterToScreen()

0
 

Author Comment

by:SETP
ID: 13986049
Thanks! As a matter of interest, I checked the MSDN help on this method and this is what it says:

This member supports the .NET Framework infrastructure and is not intended to be used directly from your code.
0
 
LVL 19

Expert Comment

by:arif_eqbal
ID: 13993196
Thanks for that bit SETP
so its a function that the Framework uses
Now the point is why they say "not intended to be used directly"
I mean what's the harm

if not for this single call you'd have had to write a sizeable amount of code to achieve the same result...
0
 

Author Comment

by:SETP
ID: 13993881
I completely agree with you. All I know is that that code works perfectly for me and that's all that matters! :)

Thanks arif_eqbal
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
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.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

872 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