|
-
Nov 8th, 2000, 02:45 PM
#1
Thread Starter
Hyperactive Member
Hi there,
How can I assign a string to a piece of text which is something other than Normal font?
I want to assign a string to the 'less than or equal to sign', <=, which is symbol font.
If it was a normal character, like '<', I'd simply say:
dim sign as string
sign = "<"
But to get the 'less than or equal to sign" in a picturebox you need to write:
Form1.Picture1.Font = "symbol"
Form1.Picture1.Print " £ ";
Form1.Picture1.Font = "comic sans ms"
How can I make this a string?
I mean, you can just put:
dim sign as string
sign= Form1.Picture1.Font = "symbol"
Form1.Picture1.Print " £ ";
Form1.Picture1.Font = "comic sans ms"
Any ideas? Is it even possible?
Please help!
Thanks.
-
Nov 8th, 2000, 03:44 PM
#2
Use the Chr() function to assgin a character value. For example, say that £ is Chr 16. Then you would use...
Code:
Dim Sign As String
Sign = Chr(16)
-
Nov 9th, 2000, 06:08 AM
#3
Thread Starter
Hyperactive Member
Megatron,
Thanks. Can every single character, regardless of whether its font is times new roman, symbol, or whatever, be assigned a Chr()?
Where can I find a list of all the Charcodes? I've been searching for well over an hour now, on the MS vb site and everywhere, with no luck.
Thanks.
-
Nov 9th, 2000, 06:24 AM
#4
Fanatic Member
They are set as far as I know eg i always used Chr(13) in a MsgBox to emulate the <ENTER> key.
To get a list, create a table and populate it using recordsets based on this:
Code:
For i = 0 To 255
rs.AddNew
rs(0) = i
rs(1) = Chr(i)
rs.Update
Next
Hope this helps
-
Nov 9th, 2000, 11:14 AM
#5
0 to 32 will not be listed because they are not characters.
Code:
Private Sub Form_Load()
For i = 33 to 255
List1.AddItem Chr(i)
Next
End Sub
Private Sub List1_DblClick()
Clipboard.Clear
Clipboard.SetText List1.text
End Sub
For more, look in your MSDN Libary (or help file) for ANSI.
That's all you need .
-
Nov 10th, 2000, 08:09 AM
#6
Thread Starter
Hyperactive Member
Thank you all for your help. The nearest I can get to the symbol I want, <=, is:
Picture1.Font = "symbol"
Picture1.Print Chr(163)
There is no character code for it. Is it possible to assign the above to a string? I 'm sure there must be.
For example, it's easy to assign chr(163) to a string like:
dim sign as string
sign= chr(163)
Picture1.print "The man had " & sign & "100."
----------------
But this doesn't work:
dim sign as string
sign = "symbol" And chr(163)
Picture1.print "The man had " & sign & "100."
Any ideas? Thanks for any help
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|