Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

load a form full screen / dead center

Posted on 2003-12-05
6
Medium Priority
?
261 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 500 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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.
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

722 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