Solved

load a form full screen / dead center

Posted on 2003-12-05
6
253 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Cannot Load VB6 on Windows 10. Installed OK but error on opening existing project. 7 129
Access 2013 combo box not working 3 75
vbModal 12 75
Problem to line 23 80
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…

738 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