Solved

Font Changes

Posted on 1998-07-08
5
184 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

773 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