Results 1 to 5 of 5

Thread: Can I use a special character on a control?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    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
    Attached Images Attached Images  

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,422

    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

  3. #3
    Addicted Member
    Join Date
    Sep 2007
    Location
    Right behind you
    Posts
    170

    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

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Jul 2006
    Location
    MI
    Posts
    2,012

    Re: Can I use a special character on a control?

    Thanks, that worked. Are there any potential problems with using these special characters?

  5. #5
    Addicted Member
    Join Date
    Sep 2007
    Location
    Right behind you
    Posts
    170

    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.

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