Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with VB form and large fonts 2

Status
Not open for further replies.

Digsy

Programmer
Sep 5, 2002
202
GB
Hello all,

I have designed a form to fit 800x600 resolution (so pretty much any laptop/old monitor can view it)which it does on my PC running with Small Fonts, however when i try it out on a PC with Large Fonts installed it no longer fits on 800x600.

Is there any way to stop my form being resized by changing between large/small fonts?

If not are there any sensible workarounds that i could look at without having to have two separately designed forms, one for small fonts and another for large fonts?


Thanks in advance.

Dave
 
strongm gave me this code not so long ago,
Code:
Private Const LOGPIXELSX = 88

Private Declare Function GetDeviceCaps Lib "gdi32" _
    (ByVal hdc As Long, ByVal nIndex As Long) As Long

Private Declare Function GetDC Lib "user32" _
    (ByVal hwnd As Long) As Long

Public Function isLargeFonts() As Boolean
    isLargeFonts = (GetDeviceCaps(GetDC(0), LOGPIXELSX) <> 96)
End Function

I think the value for small fonts is 120 but you will have to verify that.


>Is there any way to stop my form being resized...

what do you mean with that? What behaviour are you trying to achieve?
 
The thread where the original version of this code was presented is here: thread222-784425
 
Yes sorry, 120 is for small fonts and 96 is for large.
 
Thank you both for your help.

Cheers,

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top