Results 1 to 4 of 4

Thread: Set FontSize on Dialog Label

  1. #1
    Member dcromley's Avatar
    Join Date
    Apr 2009
    Location
    Wyoming, USA
    Age
    86
    Posts
    80
    Rep Power
    23

    Set FontSize on Dialog Label

    I want to use a Dialog (first time). I want to increase the FontSize on a label.
    A relevant msdn Reference
    This reference has:
    btn3.FontSize = 10.0

    -- SO -- is there an API I could use for the Label FontSize?
    Thanks in advance.

    Uses "UI"
      Global hdlg As DWord   
    
    Sub TBMain()
      Dialog New Pixels, 0, "Dialog Window", 40, 30, 400, 300, 0 To hdlg   
      Dialog Set Color hdlg, -1, Rgb(200, 200, 100)
      Control Add Label, hdlg, 1001, "Label text here", 10, 10, 180, 20
    ' at this point I want to set the label fontsize
      Control Add Button, hDlg, 1002, "Hit me to exit", 10, 40, 180, 20 Call cb1
      Dialog Show Modal hdlg
    End Sub     
    
    CallBack Function cb1() As Long
      Dialog End hdlg
    End Function
    

  2. #2
    Hi,

    Maybe this topic can help you?

    http://www.thinbasic.com/community/s...nt-for-a-label

    catventure.
    http://tab.thinbasic.com - Home Of The ThinBasic Adventure Builder Project. (Interactive Fiction/Text Adventure Maker)

  3. #3
    Member dcromley's Avatar
    Join Date
    Apr 2009
    Location
    Wyoming, USA
    Age
    86
    Posts
    80
    Rep Power
    23

    Use "CreateFont" and "Control Send", thanks

    [deleted -- a poor example]
    Last edited by dcromley; 23-01-2016 at 01:43.

  4. #4
    Member dcromley's Avatar
    Join Date
    Apr 2009
    Location
    Wyoming, USA
    Age
    86
    Posts
    80
    Rep Power
    23
    I didn't read your link (Petr's) carefully enough -- it is simpler, better, doesn't use CreateFont:
    (I can't believe my earlier searches didn't find this -- I was using "size", I guess)
      Uses "UI"
    
      Global hDlg As DWord   
    
    Sub TBMain()
      Dialog New Pixels, 0, "Dialog Window", 40, 30, 400, 300, 0 To hDlg   
      Dialog Set Color hDlg, -1, Rgb(240, 240, 160)
      Control Add Label, hDlg, 1001, "Label One - Default", 10, 10, 180, 20
      Control Add Label, hDlg, 1002, "Label Two - Whatever", 10, 40, 180, 20
      Dim hFont As DWord Resource = Font_Create("Arial Black", 12) 
      Control Send hDlg, 1002, %WM_SETFONT, hFont, 0 
      Control Add Button, hDlg, 1003, "Hit me to exit", 10, 70, 180, 20 Call cbexit
      Dialog Show Modal hDlg
    End Sub     
    
    CallBack Function cbexit() As Long
      Dialog End hDlg
    End Function
    
    Last edited by dcromley; 23-01-2016 at 01:34. Reason: add "I can't believe .."

Similar Threads

  1. different font for a label
    By sandyrepope in forum UI (User Interface)
    Replies: 4
    Last Post: 26-02-2012, 19:48
  2. click on a Label
    By zak in forum UI (User Interface)
    Replies: 2
    Last Post: 16-04-2011, 14:49
  3. Confusion with DIALOG GET/SET CLIENT, DESKTOP GET SIZE and DIALOG SET LOC
    By Michael Hartlef in forum UI (User Interface)
    Replies: 3
    Last Post: 03-10-2008, 19:23
  4. add label bug or my mistake
    By sandyrepope in forum UI (User Interface)
    Replies: 2
    Last Post: 08-09-2007, 23:07
  5. get label background color
    By sandyrepope in forum UI (User Interface)
    Replies: 1
    Last Post: 09-07-2007, 00:45

Members who have read this thread: 0

There are no members to list at the moment.

Tags for this Thread

Posting Permissions

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