Solved

Font Changes

Posted on 1998-07-08
5
188 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
[X]
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
  • 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

739 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