Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Developer Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
find Monitor Resolution
Sami Shamma 
             
2 years ago
Greetings all.

I am using Richard's "Resize Forms" for a customer. Is there a way to find out what the resolution of the monitor is so I can set the zoom to match?
Adam Schwanz  @Reply  
           
2 years ago
Option Compare Database
Option Explicit

Private Declare PtrSafe Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long

Private Const SM_CXSCREEN As Long = 0
Private Const SM_CYSCREEN As Long = 1

Private Sub Command0_Click()
    Dim screenWidth As Long
    Dim screenHeight As Long
    
    screenWidth = GetSystemMetrics(SM_CXSCREEN)
    screenHeight = GetSystemMetrics(SM_CYSCREEN)
    
    MsgBox screenWidth & " x " & screenHeight
End Sub
Adam Schwanz  @Reply  
           
2 years ago
I don't know if that behaves if you have multiple monitors with different screen resolutions, but it works if theyre the same :P
Alex Hedley  @Reply  
           
2 years ago
Command0_Click . . .
Adam Schwanz  @Reply  
           
2 years ago
Hey it's just example :P. I'm a good boy, I use real names on the real stuff lol.
Sami Shamma OP  @Reply  
             
2 years ago
Thank you Adam

ChatGPT just gave me the same code.

Alex, keep Adam honest with naming his buttons
Kevin Robertson  @Reply  
          
2 years ago
Yeah, I always name my buttons.

Here are my main naming conventions;
    Buttons:               btnMyControl
    Labels:                lblMyControl (If referenced in code)
    Textboxes:          txtMyControl (Unbound)
    Combo Boxes:       cboMyControl
    List Boxes:            lstMyControl
    Check Boxes:        chkMyControl
    Option Buttons:     optMyControl
    Option Groups:      fraMyControl
Adam Schwanz  @Reply  
           
2 years ago
Sami that's where I got it :p threw it in quick to make sure it worked before I posted.
Kevin Robertson  @Reply  
          
2 years ago
Yes Adam I also test EVERYTHING I get from ChatGPT Doesn't always get it right first time.
Alex Hedley  @Reply  
           
2 years ago
Glossary: Naming Convention

p.s. Leszynski FTW
Kevin Robertson  @Reply  
          
2 years ago
I always prefix my modules with 'mod'.

For example:
    modGlobal
    modImages
    modFunctions
Garry Smith  @Reply  
    
2 years ago
Once the user's monitor's resolution is known, what needs to be done to set the database window, forms, or reports to match in comparison with the resolution that it was designed in? Howpe this make sense.
Sami Shamma OP  @Reply  
             
2 years ago
Richard did not cover this, but if you watch Access Developer 41 it is just the next step

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Developer Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/6/2026 6:30:52 PM. PLT: 1s