473,700 Members | 2,754 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Make forms show up in middle of screen

489 Contributor
Why is it that on laptops with wide screens that my application screens show up on the right side of the screen and the user has to drag the screen into the middle. Is there a way to make the screen always show up in the middle of the screen?
Thanks for any help.
Feb 10 '09 #1
19 18614
ChipR
1,287 Recognized Expert Top Contributor
I've noticed this too when working on my frontend on 2 monitors. Even though my forms are all set to centered, when I compile and distribute it, users have forms open up way off center, maybe relative to where I have them while developing. I think it has helped to make sure I open Acess in a regular size window, then open the forms and make sure they are centered there before I make the accdr (or mde). It seems really inconsistent though, and I haven't collected too much evidence.
Feb 10 '09 #2
ADezii
8,834 Recognized Expert Expert
@CD Tom
You can always make sure that Forms always show up in the 'Middle' of the Screen regardless of Screen Resolution or other factors, but the code is complex and involves judicious use of the API. If you are interested, I'll create a Demo DB that will illustrate this functionality for you.
Feb 10 '09 #3
CD Tom
489 Contributor
That would be great, If you can just give me the code I can probable figure it out, unless it's easier doing the demo DB. Thanks
Feb 10 '09 #4
ADezii
8,834 Recognized Expert Expert
@CD Tom
  1. Download the Attachment, it will make things a little easier.
  2. Within your Database, Import the FormInfo Class from the Demo Database. Almost the entire code functionality is encapsulated within this Class.
  3. In the General Declarations of your Form, declare a variable to represent the FormInfo Class, as in:
    Expand|Select|Wrap|Line Numbers
    1. Private mfi As FormInfo
  4. In the Form's Load() Event, create a New Instance of the Class, set its Form Property to the Form where code is currently executing (Me), then Call the Center Method of the Class to Center the Form.
    Expand|Select|Wrap|Line Numbers
    1. Private Sub Form_Load()
    2.   Set mfi = New FormInfo
    3.   Set mfi.Form = Me
    4.     mfi.Center
    5. End Sub
  5. Reposition the Form, and Click on the Command Button at any time to Re-Center it on the Screen.
  6. Disregard any related Properties, Methods, and Declarations from the FormInfo Class if they are not needed.
Feb 11 '09 #5
CD Tom
489 Contributor
Thanks I'll let you know when I get everything working.
Feb 11 '09 #6
CD Tom
489 Contributor
I've just got around to trying this and have a couple of errors. When I try and compile the program I get a error on Private mfi as formInfo the message is "Compile Error: A module is not a valid type" not to sure what to do next.
Feb 16 '09 #7
CD Tom
489 Contributor
I was able to fix the first error but now I'm getting an on the the following line: .STATE = Val(Getsetting( appName, strName, adhcState, me.WindowState) ) when I try and compile get an error on WindowState Compiler error: Method or data member not found" Got any ideas what's causing this.
Thanks, the program will run and the form does allign but the error comes up when I compile.
I ran the compile on your database and get the same error. Are we missing a ref or something?
Feb 17 '09 #8
ADezii
8,834 Recognized Expert Expert
@CD Tom
I'll look into it as soon as I get a chance.
Feb 17 '09 #9
ADezii
8,834 Recognized Expert Expert
@ADezii
WindowState is a Property of the FormInfo Class as evidenced by a pair of Property Let/Get Procedures contained within this Class. It appears as though a Variable has not been Declared as FormInfo, or that it has not properly been instantiated. Double-Check Steps 3 and 4 in Post #5, and make sure these Lines of Code are present exactly where they should be. Get back to me on this.
Feb 17 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1693
by: BuzzLight | last post by:
This is my problem :- - I have set a form frmSplash as the startup form instead of sub Main. - This means I dont create an instance of it myself at startup.. its automatically created. - I have a timer on frmSplash set to 3000 ms interval - and here is its tick event : Private Sub tmrStartup_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles tmrStartup.Tick Dim frmParent As New frmParent frmParent.Show() Me.Close()
1
1163
by: BuzzLight | last post by:
Thanks alot Charles m8, your suggestion was very useful, Iam very new to vb.net ... I used application.run and it works fine but I do not know what "Application.Run" means.. what it does.. But Thankyou for your help
0
1113
by: Ronald S. Cook | last post by:
Can't make forms authentication for non-ASPX files work In my web app, I want to secure not only .aspx files, but also .htm files. From what I've read, I have to jump through some hoops to protect the .htm files. In IIS, I right clicked on the default web site and clicked on the ISAPI Filters tab. I added ".htm" and chose "C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" as the executable.
1
1822
by: DBC User | last post by:
I am wondering is there any way when I do a show and hide of a form, we can do a smooth transition to the new screen like power point presentation in c#?? Thanks.
1
1278
by: den | last post by:
if I want to open a popup at middle of screen in some example I see that is used also Math.round; is obligatory? there are situation where the result of screen/2 if isn¢t an integer can to cause prolems?
3
2074
by: jlb | last post by:
I am converting a VB6 app to .NET Visual Studio 2005. I have about 20 forms. Ths app starts with Main_form, and then passes to a "loop" of about 14 forms that pass from 1 to another, with the possiblity of passing back and forth. The cylce can go on repeatledly without passing back to the "parent" form Main_form. My problem is everything flows along until I try to "repeat" the form.show/form.dialog. Then the form can't display, or I get the...
0
4575
Shashi Sadasivan
by: Shashi Sadasivan | last post by:
Hi All, i Have an application functionaluty which has 4 forms which are needed to interact by the user by dragging data from these forms to one another the main form is located in the MDI Parent and the rest are on their respective screen (3 other secondry screens) At the moment i am testing using 2 screens but i get a very similar behavious when i run it on a 4 screened system. For the 2 screen system: form1 opens in primary screen (ie...
0
8712
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9203
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8952
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7794
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6555
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5895
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4649
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.