Solved

Font Changes

Posted on 1998-07-08
5
183 Views
Last Modified: 2013-12-03
I have written a program while my settings on my computer is for small font.  When  I put the same program on machines for my users some of them have changed thier display setting to large font.  WHen this is the case my visual basic screens don't fit on the screen.  Is there a way to tell the program when it loads to someway change the settings or some other way to get around this problem..other than making sure all users have thier display set a certain way?
0
Comment
Question by:kellyegg
  • 2
  • 2
5 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1465257
kellyegg,
As far as I know, this problem can not be solved even if you resize your form and controls for the specific screen resolution on the user's machine. The only way to solve it is that the user must change his font size to small fonts.
0
 
LVL 6

Accepted Solution

by:
anthonyc earned 30 total points
ID: 1465258
Kelly....

Here is some code to detect if the user has large or small fonts.   Send me an email at aecornetto@sai2000.com and we can attempt to work out something that will change the setting.  This only reads the setting:

   Public Declare Function GetDesktopWindow Lib "user32" () As Long

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

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

   Public Declare Function ReleaseDC Lib "user32" _
     (ByVal hwnd As Long, ByVal hdc As Long) As Long

   Public Const LOGPIXELSX = 88
   Public Const LOGPIXELSY = 90

Private Function IsScreenFontSmall() As Boolean

    Dim hWndDesk As Long
    Dim hDCDesk As Long
    Dim logPix As Long
    Dim r As Long
   
   'get the handle to the desktop window  
    hWndDesk = GetDesktopWindow()
   
   'get the handle desktop display context (hDC)  
    hDCDesk = GetDC(hWndDesk)
   
   'get the horizontal logical pixels  
    logPix = GetDeviceCaps(hDCDesk, LOGPIXELSX)
   
   'release the hDC  
    r = ReleaseDC(hWndDesk, hDCDesk)
   
   'if the return from GetDeviceCaps is 96, then the system is
   'using small fonts.  If the system is using small fonts,
   'the return value will be 96.  
    IsScreenFontSmall = logPix = 96
 
End Function

sub main
   if isscreenfontsmall then msgbox "The screen font is small"
end sub
0
 

Author Comment

by:kellyegg
ID: 1465259
The previous answer was good but not exactly what I was looking for.... I have found a function dealing wiht a sub routine called display changed that I found in the online help.  I can not get it to work correctly and I would like to know if anyone knew anything about the sysinfo control function? thanks
0
 
LVL 6

Expert Comment

by:anthonyc
ID: 1465260
Kelly..

send me an email... We can work this out together....   The sysinfo control is pretty weak...  

Anthony

aecornetto@sai2000.com
0
 

Author Comment

by:kellyegg
ID: 1465261
I have been working with the sysinfo control and can not get it to work...I put a control on my form and when I restart the computer it does nothing!! Does anyone else have any ideas?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel Spreadsheet - Send email if certain value is selected. 14 85
VB 6.0 printer how to align 6 57
what font behind pdf 32 127
Passing a Text Box name to a Sub 6 69
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

930 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now