Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create a tool box that lets user enter special characters

How to

Create a tool box that lets user enter special characters

by  randysmid  Posted    (Edited  )
Hi,
It is relatively easy to create a toolbox on the form that will insert special characters into a textbox.

1) Create the desired number of command buttons on your form for each special character, e.g., cmdTrademark, cmdCopyright, cmdPoundSign, etc. Leave the caption of these buttons blank, because they will be set in the Open Event for the form with this code:
cmdTrademark.Caption = chr(174)
cmdCopyright.Caption = chr(169)
cmdPoundSign.Caption = chr(163)

(to see the complete set of characters, go into Visual Basic help and search for Character Set 128 - 255)

2) The clicked event for each command button will append the special character to the text box desired. For instance, to insert the trademark symbol into a text box called txtInputText, you would use this code:
txtInputText.value = txtInputText & Chr(174) 'trademark
'note the use of the "value" property, not "text"

3) By neatly organizing your command buttons and placing a label at the top (such as "Insert Special Character"), you will end up with a very user-friendly method of adding special characters.

HTH, Randy Smith
rsmith@cta.org
[pc2]
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top