Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Centre fame contained within a form in vb.net

Posted on 2007-07-25
1
Medium Priority
?
185 Views
Last Modified: 2013-11-26
Hi,

I have a form called frmMaster and a frame called fraCover on the form. I am trying to find out how I centre the frame on the form in code please.

Many Thank
Lee
0
Comment
Question by:ljhodgett
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 2000 total points
ID: 19565268
Lee,

Try this:

Dim x As Integer = (Me.ClientSize.Width - fraCover.Width) \ 2
Dim y As Integer = (Me.ClientSize.Height - fraCover.Height) \ 2
fraCover.Location = New Point(x, y)

Bob
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month21 days, 7 hours left to enroll

805 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