Solved

load a form full screen / dead center

Posted on 2003-12-05
6
250 Views
Last Modified: 2012-05-04


how can i load my form to be
a) full screen and filling all the corners,(dead center)
by that i mean i dont have to move it up and left to fill

the screen, and no part is on the far right past the screen.

b) load my normal form, (size is smaller than the full

screen) dead center.

c) can i load it like this when i debug?
0
Comment
Question by:jxharding
6 Comments
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9881335
Hi jxharding,

Private Sub Form_Load()
'set the startup position to center screen in form properties
Me.Width = Screen.Width
Me.Height = Screen.Height
End Sub



Cheers!

Rajesh
0
 
LVL 24

Expert Comment

by:R_Rajesh
ID: 9881362
also you might want to set the windowstate to maximized in form properties
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 9881381
If you use R_Rajesh's method, then add:

Me.Top = 1
Me.Left = 1

To place your form where it is supposed to be.
0
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.

 
LVL 11

Expert Comment

by:dbrckovi
ID: 9881385
Sorry R_Rajesh.

I wasn't paying attention to    >>   'set the startup position to center screen in form properties
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9881919
Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_GETWORKAREA = 48

Private Type RECT
   Left As Long
   Top As Long
   Right As Long
   Bottom As Long
End Type

Private rc As RECT

Private Sub Form_Load()
SystemParametersInfo SPI_GETWORKAREA, vbNull, rc, 0
Me.Move rc.Left * Screen.TwipsPerPixelX, rc.Top * _
           Screen.TwipsPerPixelY, rc.Right * _
           Screen.TwipsPerPixelX, rc.Bottom * _
           Screen.TwipsPerPixelY
End Sub
0
 
LVL 4

Accepted Solution

by:
learning_t0_pr0gram earned 125 total points
ID: 9884876
do you even need code for that? just change (in the properties for the form) WindowState to Maximized, BorderStyle to None, and Startup in the center of the screen
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
How to debug this code 7 64
Copy a row 12 64
fso.FolderExists("\\server\HiddenFolder$") 4 78
VB6 common control 6 sp6 object library not registerd 3 23
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

820 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