Results 1 to 2 of 2

Thread: Adjust to different Monior/Display Resolution?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151
    I want my application to change size of forms and various controls to accomodate different monitors and different resolutions for the same monitor. I am doing some point plotting, using ScaleMode 7 (Centimeters) for a Picture Box (where I plot points) and ScaleMode 1 (Twips) elsewhere.

    Any advice, hints, citations, etcetera would be appreciated.

    I am working with VB6. I have Visual Studio & MSDN Library.

    First, are above Scale Modes reasonable for my purposes? They seem to work okay, but I have yet to add logic for Display changes.

    MSDN shows sample code using Sysinfo1_Displaychanged Event. Example uses Screen.TwipsPerPixelX to decide how to size controls. For my System, TwipsPerPixelX does not change when I change from 640X480 to 1024X768. An experiment suggests that Sysinfo1.WorkAreaWidth changes. Does ScaleMode setting affect these variables?

    What affects TwipsPerPixel? How do I check for Display Resolution? How do I detect a Monitor with a different Dot Pitch? Should I worry about Dot Pitch?

    Any clues you can give me about Twips, Pixels, Scale Mode, Screen sizes, et cetera would be appreciated.

    Thanx
    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  2. #2
    Hyperactive Member Zaphod64831's Avatar
    Join Date
    Mar 2000
    Posts
    268

    Post Off the top of my head...

    Here's some code off the top of my head, be sure to create a text box named text1 and a timer named timer1.

    P.S. Sorry about the bad presentation, I can't remember how to display code.


    Dim OldWidth, OldHeight

    Private Sub Form_Load()
    Text1.Text = Str$(Screen.Width) + "," + Str$(Screen.Height)
    OldWidth = Screen.Width
    OldHeight = Screen.Height
    End Sub

    Private Sub Timer1_Timer()
    If Screen.Width = OldWidth Then
    Text1.Text = Str$(OldWidth) + "," + Str$(OldHeight)
    Else
    MsgBox ("Screen resized from " + Str$(OldWidth) + ","+_
    Str$(OldHeight) + " to" + Str$(Screen.Width) + "," +_
    Str$(Screen.Height) + ".")
    OldWidth = Screen.Width
    OldHeight = Screen.Height
    End If
    End Sub
    Email: [email protected]

    Home Page: www.olemac.net/~hutch

    I'm bored, VERY bored, and I got bored with my sig. So I changed it to this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width