Results 1 to 8 of 8

Thread: Small and Large fonts

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Finland
    Posts
    39

    Angry

    I have created some kind of calendar program. It seemed to work fine, until... I tried it with another computer. I found out that the cause was fonts.

    My program works fine with large fonts (Panel -> screen -> Large/Small fonts) but when I try it with small fonts all fields, whose place I have set with code (textbox.top...) comes to different places than those, I have just (drag and drop) moved on the screen.

    I use pixels in giving objects their places... OK?
    What should I do? Make all locations with code? (I mean .top and .left...) Too many objects for that...

    (Sorry my bad english)

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Finland
    Posts
    39
    Nobody answers...
    Does this mean that nobody has made program that works with large and small fonts and uses both setting objects (textbox, label...) on the form and uses .top and .left in the code?
    If somebody knows, I really need this information!

  3. #3
    New Member
    Join Date
    Dec 2000
    Posts
    4
    use something like:

    Private Const SM_CXFULLSCREEN = 16
    Private Const SM_CYFULLSCREEN = 17


    Public Sub CenterForm(frm As Form)

    Dim Left As Long, Top As Long
    Left = Screen.TwipsPerPixelX _
    * (GetSystemMetrics(SM_CXFULLSCREEN) / 2) - _
    (frm.Width / 2)
    Top = Screen.TwipsPerPixelY _
    * (GetSystemMetrics(SM_CYFULLSCREEN) / 2) - _
    (frm.Height / 2)
    frm.Move Left, Top

    End Sub


    this should place, say a msgbox in the center of the screen

  4. #4
    Addicted Member Rudy's Avatar
    Join Date
    Sep 2000
    Location
    BC, Canada
    Posts
    198
    i think it's better if you make the program in small font.....i think u have less chances of getting screwed when you'll install to a computer with large font......but why would you use large font anywayz??
    *Rudy^
    Visual Studio 6 Ent. SP5
    Windows 2000 SP4
    Windows XP SP1a

  5. #5

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Finland
    Posts
    39
    I am using large fonts. But all of users aren't... I'll try these. I will inform you if I can't get them work, but thank you for now!

  6. #6

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Finland
    Posts
    39
    I tried this script two ways. First i made new module and called this code with
    call centerform()
    Yeah, it does need argument. what? When my mainform is named to "base", I tried to call it
    call centerform(base)
    That wasn't better. Then I tried to just copy this code to form_load(). It said me that can't find GetSystemMetrics() sub...

    You know, I am a newbie...

  7. #7
    New Member
    Join Date
    Dec 2000
    Posts
    4
    When you change your system to use large fonts, it should have told you that some programs may look strange. That is probaby what is causing the problem. It's recommended not to use large fonts, unless you find it hard to see.

    Sorry, i forgot to put in the system metrics code. I'll post it on monday for you. I'm not on my computer right now and that's where i have the code at. later

  8. #8

    Thread Starter
    Member
    Join Date
    Dec 2000
    Location
    Finland
    Posts
    39
    I am using 1024x768 resolution with 17inch screen. This means that small fonts look VERY small.

    And... I am not making this program for myself. I created it for one team. Some of them do have large and some small fonts =(

    So how to make that code to work out?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width