Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Font Changes

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
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…

809 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