|
-
Apr 27th, 2000, 11:46 PM
#1
Thread Starter
Frenzied Member
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.
-
Apr 28th, 2000, 12:51 PM
#2
Hyperactive Member
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|