8 Replies - 939 Views - Last Post: 12 December 2008 - 01:01 AM Rate Topic: -----

#1 Jaalenn  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 105
  • Joined: 17-November 08

Specific Characters in VB6

Posted 02 December 2008 - 06:41 AM

Does anyone here know how to display a specific character in a label in VB6? I have been trying to use several but end up with a placeholder character. One example of a character I'm trying to utilize is .

Any help would be appreciated.
Is This A Good Question/Topic? 0
  • +

Replies To: Specific Characters in VB6

#2 VB Crash  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 130
  • Joined: 28-November 08

Re: Specific Characters in VB6

Posted 02 December 2008 - 07:13 AM

You could use for ex: Chr(247).
I'm not sure for the specific character. Plase post some code.

Vace
Was This Post Helpful? 0
  • +
  • -

#3 thava  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 180
  • View blog
  • Posts: 1,606
  • Joined: 17-April 07

Re: Specific Characters in VB6

Posted 02 December 2008 - 04:36 PM

better you use the symbol font for the label
Was This Post Helpful? 0
  • +
  • -

#4 FractalP  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 03-December 08

Re: Specific Characters in VB6

Posted 03 December 2008 - 04:57 AM

The function you would need is the Chr() function as VB Crash said. This simply takes an ASCII value and converts it to the corresponding character. Asc() is the counterpart to this, converting a character into an ASCII code.
For instance:
Chr(86) would return "V"
Asc("B") would return 66

It is simple enough to write a small piece of code which accepts input and gives a corresponding ASCII code if you can't find it on a table.

Hope this helps :)

~Chris
Was This Post Helpful? 1
  • +
  • -

#5 Jaalenn  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 105
  • Joined: 17-November 08

Re: Specific Characters in VB6

Posted 09 December 2008 - 01:25 PM

Thanks a lot for the ideas guys, sadly they didn't work... for some reason the will not show properly in vb.

and the asc value is 134 (Alt+0134)

Chr(134)


Was This Post Helpful? 0
  • +
  • -

#6 FractalP  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 11
  • Joined: 03-December 08

Re: Specific Characters in VB6

Posted 09 December 2008 - 06:10 PM

View PostJaalenn, on 9 Dec, 2008 - 12:25 PM, said:

Thanks a lot for the ideas guys, sadly they didn't work... for some reason the will not show properly in vb.

and the asc value is 134 (Alt+0134)

Chr(134)



Oh? It works fine in VB6 on my computer. Try typing:
MsgBox Chr(134)

It should show a message box with the character you mentioned. Could you clarify what you mean by 'will not show properly'?
Was This Post Helpful? 0
  • +
  • -

#7 VB Crash  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 130
  • Joined: 28-November 08

Re: Specific Characters in VB6

Posted 10 December 2008 - 01:25 AM

This work for me...
MsgBox Chr(134)





Vace
Was This Post Helpful? 0
  • +
  • -

#8 Jaalenn  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 1
  • View blog
  • Posts: 105
  • Joined: 17-November 08

Re: Specific Characters in VB6

Posted 11 December 2008 - 06:06 PM

Yes, it will work just fine in a message box. My problem, as stated in the original post, is that it will not display properly in a Label. I have yet to find a workable solution and have abandoned the idea of using it. Thank you all anyway for your help, and input.
Was This Post Helpful? 0
  • +
  • -

#9 born2c0de  Icon User is offline

  • printf("I'm a %XR",195936478);
  • member icon

Reputation: 180
  • View blog
  • Posts: 4,667
  • Joined: 26-November 04

Re: Specific Characters in VB6

Posted 12 December 2008 - 01:01 AM

Quote

My problem, as stated in the original post, is that it will not display properly in a Label.

The Label uses the MS Sans Serif Font by default, which does not support such characters.

Change the font to say Times New Roman or Comic Sans MS and it works.
Other fonts may work too.
:)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1