Text Field unicode symbol

How do I get a text field to display a card suit symbol? For example As, where the A might be in the Arial font and the s should be a spade symbol (Unicode 2660)? I’m using a Mac and I don’t have an extended keyboard. The suit symbol might be in a different color to the text character.

I see a text field won’t do it. It doesn’t need to be editable but it looks as though a label won’t do it either. Do I really have to use a text area sledgehammer to crack a nut? Maybe I’d better use graphics. Just a different sledgehammer.

TextField and TextArea and based on the same (TextEdit) Control.

You have to search elsewhere…

Somewhere in the Control Panel-, you can add a Keyboard Menu in the MenuBar as:

image

Once you have that, select “Show the Keyboard visualizer›” and you will have access to whatever character is displayed.
Press the Control, Option (Alt), Shift, keys to display different characters…

Thanks, Emile, I think I’ll make do with s, h, d and c for now

You found nothing in the Emojis ?
(same location as Keyboard to get the visual list)

Example (but there are far more available characters):

See wikipedia:

it lists them all:

🂡 🂱 🃁 🃑
🂢 🂲 🃂 🃒
🂣 🂳 🃃 🃓
🂤 🂴 🃄 🃔
🂥 🂵 🃅 🃕
🂦 🂶 🃆 🃖
🂧 🂷 🃇 🃗
🂨 🂸 🃈 🃘
🂩 🂹 🃉 🃙
🂪 🂺 🃊 🃚
🂫 🂻 🃋 🃛
🂬 🂼 🃌 🃜
🂭 🂽 🃍 🃝
🂮 🂾 🃎 🃞


You are right.

Faster to find when you know they exists.

I think a Label will do. In its Open(ing) event:

me.Text = &u2660
me.TextColor = Color.Red
me.FontSize = 32

Or copy / Paste from one of the windows I shared (in fact, a click is enough)…

Kem’s suggestion works fine in Labels to the extent of producing a red Spade suit symbol. I can get the rank as well by putting

me.Text = "A" + &u2660.

I have been using an array to set up the text content of a control set of 52 text boxes as follows - this may not be as simple with unicode. I tried it quickly in the text fields set and it rendered the unicode as literal text

Var names(51) as string
names = Array("2C","3C","4C","5C","6C","7C","8C","9C","TC","JC","QC","KC",etc etc)
For n as integer = 0 to 51
 tf(n).FontName = "ArialBold"
 tf(n).FontSize = 24
 tf(n).Text = names(n)
 tf(n).TextColor = colG
Next

The idea is to select cards from a full deck by clicking on the boxes.colG is a predefined grey colour that is replaced by red or black for the red and black suits after card selection. As well as using the proper suit symbols I would have preferred to keep the red and black colouring only for the actual suit symbols but that doesn’t matter so much.

Yes, thanks everyone, the following now works. Firstly populating the grid of 52 text fields - labels not required.

For n as integer = 0 to 51
  tf(n).FontName = "ArialBold"
  tf(n).FontSize = 24
  tf(n).TextColor = colG 'light grey
Next
Var names(12) as string
names = Array("2","3","4","5","6","7","8","9","T","J","Q","K","A")
For n as integer = 0 to 12
  tf(n).Text = names(n) + &u2663 'Club suit symbol
Next
For n as integer = 13 to 25
  tf(n).Text = names(n - 13) + &u2666 'Diamond suit symbol
Next
For n as integer = 26 to 38
  tf(n).Text = names(n - 26) + &u2665 'Heart suit symbol
Next
For n as integer = 39 to 51
  tf(n).Text = names(n - 39) + &u2660 'Spade suit symbol
Next

and this is the Text Field Mouse Down event that colours the cards or greys them out again on a second click

If me.TextColor <> colG then
  me.TextColor = colG
  cSelected = cSelected - 1 'number of cards currently selected
Elseif me.index < 13 or me.index > 38 Then 'Clubs and Spades
  me.TextColor = colB 'Black
  cSelected = cSelected + 1
Else 'Diamonds and Hearts
  me.TextColor = colR 'Red
  cSelected = cSelected + 1
End

Thanks very much for the help