Results 1 to 5 of 5

Thread: [RESOLVED] Display Ø (phi) in a label on a form

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Resolved [RESOLVED] Display Ø (phi) in a label on a form

    Can anyone tell me how to display a Ø symbol on a form?
    Can't seem to put ALT-0216 in the labels.caption at design time. No idea how to do it at run time.
    I can only think of inserting it as an image which might not look so good.

  2. #2
    A SQL Server fool GaryMazzone's Avatar
    Join Date
    Aug 2005
    Location
    Dover,NH
    Posts
    7,493

    Re: Display Ø (phi) in a label on a form

    I had no problem usint the Alt keystroke method to place it in the lable in VB6. Simple placed the label on the form and in the Property Caption use the
    ALT0216 key combo to have it show up
    Sometimes the Programmer
    Sometimes the DBA

    Mazz1

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Display Ø (phi) in a label on a form

    Code:
    Private Sub Form_Load()
    Label1.Caption = Chr(216)
    End Sub

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Sep 2006
    Location
    London, UK
    Posts
    817

    Re: Display Ø (phi) in a label on a form

    ?? Sorry. I does work...
    I tried a few times I'm sure and I kept getting P.
    Maybe the textbox had a different font at the time.
    Thanks

  5. #5
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: [RESOLVED] Display Ø (phi) in a label on a form

    Φ is phi, Ø is a letter used in Scandanavian languages.
    Code:
    Option Explicit
    
    Private Const CHARSET_GREEK As Integer = 161
    Private Const LOCALE_GREECE As Long = 1032
    Private Const PHI As Integer = &H3A6
    
    Private Sub Form_Load()
        Dim strPhi As String
        
        strPhi = ChrW$(PHI)
        
        With Label1
            With .Font
                'These can be set at design time.
                .Name = "Tahoma"
                .Charset = CHARSET_GREEK
            End With
            .Caption = StrConv(StrConv(strPhi, vbFromUnicode, LOCALE_GREECE), vbUnicode)
        End With
    End Sub

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