Inserting Unicode

Oldsoftboss

AWF VIP
Local time
Today, 15:49
Joined
Oct 28, 2001
Messages
2,499
I am trying to change the caption of a command button to reflect the direction of a sort. In the Windows Character Map, the Arial Font has an upwards pointing arrow (code U+25B2) and a downward pointing arrow (code U+25BC).
How would you insert these characters to display on the command button.

Thanks

Dave
 
there should be a four digit number too, and if you hold alt (or alt gr) and type the number (using the number pad) the character should appear.
 
Here's a slightly fudgy way of getting the arrows

Using the [Aa] tool, create a label on your form (call it lbl_Arrows, say) and use the Windows character map to paste Arial’s Up and Down arrows into this label. The label now contains the two characters you want for your command button caption. Suppose the button is called cmd_Up_Down.

In the place where you’re going to set up your sort and also want to set the arrow for cmd_Up_Down, put ~ the following code

Code:
    Dim int_Up_Down As Integer
    Dim str_Caption As String
    
    '....
    
    'If sort is Ascending, set int_Up_Down = 1 : to get the first arrow
    'Otherwise, set int_Up_Down = 2 : to get the second arrow

    'Suppose the sort is Descending :

    int_Up_Down = 2

    str_Caption = Mid(Me.lbl_Arrows.Caption, int_Up_Down, 1)

    Me.cmd_Sort.Caption = str_Caption

Set your lbl_Arrows visible property to No, and it won't appear when your form is running.
 

Users who are viewing this thread

Back
Top Bottom