|
-
Jan 24th, 2004, 11:41 AM
#1
Thread Starter
Lively Member
accent thing
how would i make it so when somebody put an e in an rtf box, it would change to an é?
Last edited by endusto; Jan 24th, 2004 at 12:05 PM.
-
Jan 24th, 2004, 12:29 PM
#2
VB Code:
Private Sub RichTextBox1_KeyPress(KeyAscii As Integer)
If KeyAscii = 101 Then
KeyAscii = 233
End If
End Sub
-
Jan 24th, 2004, 09:34 PM
#3
Thread Starter
Lively Member
thanks that helps a lot, but if they put a k, how would i make it show |<
-
Jan 24th, 2004, 09:40 PM
#4
Frenzied Member
Find the ascii value of K and replace it with the 2 chars you need. Do a search on the web for ASCII and you will find a few character charts.
Can probably even find them in Character Map on your PC.
-
Jan 24th, 2004, 09:53 PM
#5
Thread Starter
Lively Member
lol, thats what i did, but i don't know how to put 2 chars
-
Jan 24th, 2004, 10:27 PM
#6
Frenzied Member
Try this
VB Code:
If keyascii = InsertAsciiCodeHere Then
RichTextBox1.SelText = "|<"
keyascii = 0
End If
-
Jan 25th, 2004, 10:23 AM
#7
Find the ascii value of K and replace it with the 2 chars you need. Do a search on the web for ASCII and you will find a few character charts.
Can probably even find them in Character Map on your PC.
To get an ASCII code simply type the following in the debug/immediate window:
Code:
print asc("character")
... and then press enter. The ASCII code should appear then.
Also Visual Basic should have a chart some where in the help files.
As for your other questions:
Code:
Private Sub Text1_KeyPress(KeyAscii As Integer)
Dim CursorPos As Integer
CursorPos = Text1.SelStart
If KeyAscii = Asc("e") Then Text1.Text = Text1.Text + Chr$(233): KeyAscii = Empty
If KeyAscii = Asc("k") Then Text1.Text = Text1.Text + "|<": KeyAscii = Empty
Text1.SelStart = CursorPos + 1
End Sub
The code probably is not the best sollution but I hope it will help you any way.
-
Jan 28th, 2004, 07:00 PM
#8
Thread Starter
Lively Member
k, thanks i got my app working nicely, but now there is another problem. i want to put a ì into it for g, but it shows up as a ? any way to fix that?
EDIT
the g, with an accent turns into an ì here. but, it looks like a g normally, but it has an accent
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
|