1 Attachment(s)
Can I use a special character on a control?
I want to set the text of a DataGridView button, in code, to a "checkmark" character. Using the Windows Character Map I found such a character in the Wingdings font (character code 0xFC), but I don't know how to use it in my code. I know how to set the text value using a standard character, but I don't know how to use special ones, or if it's even possible. Could someone please advise me? Thanks...
Here is the line of code I want to use:
Code:
Me.DataGridView1.CurrentRow.Cells(6).Value = SomeSpecialCharacter
Re: Can I use a special character on a control?
you need to set your button font to wingdings to use a wingdings character.
try using an image instead
Re: Can I use a special character on a control?
as .paul. said, put the font of the control to Wingdings, and then you do something like this
Code:
Me.DataGridView1.CurrentRow.Cells(6).Value = Convert.ToChar(&HFC)
&H, its used to specify that the number you are putting is a Hexa number. So you are inputin hex number "FC" as shown in the caracter map
Re: Can I use a special character on a control?
Thanks, that worked. Are there any potential problems with using these special characters?
Re: Can I use a special character on a control?
well if the user doesnt has the font you are using (in the case you use something that is not wingdings) then something else might come up insted, so you need to always include the font file on your installer.
Otherwise than that... i think it should be fine.