| View previous topic :: View next topic |
| Author |
Message |
szewari Newbie
Joined: 08 Jan 2004 Posts: 1
|
Posted: Jan 8th, 2004 05:38 PM Post subject: Right-to-left Text Box Control?? |
|
|
Hi folks,
I need help with creating a right-to-left Text Box control. This text box is for a language that unlike English is written from right to left. So in this text box,
you should be able to
- write from right to left
- when Enter key is pressed, the insertion point should go down to the next line on the right side.
- when the Backspace key is pressed, the insertion point should backspace and delete text from left to right, unlike in normal Text Box.
I have been able to come up with something(below, also attached). It works fine but has some problems namely
-when Backspace key is pressed, the Backspace behaves as it does in normal text box, I want the opposite of that, that is to delete from left-to-right.
-when I go to the second, third etc. line and come back to the first line. It does not behave as I expect.
Your help and time to resolve this problem will be appreciated. Thanks a lot.
Regards
Last edited by szewari on Jan 9th, 2004 10:51 AM; edited 1 time in total |
|
| Back to top |
|
Andir Centurion

Joined: 21 Dec 2003 Posts: 184 Location: Chicago Area
|
Posted: Jan 9th, 2004 12:33 PM Post subject: |
|
|
The Textbox's RightToLeft flag doesnt do that? It doesnt work on my system, but that may have something to do with the fonts I have installed or something wierd like that.
Try it out, create a standard TextBox, set your language font, and set the RightToLeft property = true. Tell me how/if it works. _________________ If you happen to see little people sitting on your desk...don't tell anyone or they might think your crazy too. |
|
| Back to top |
|
P.T.A.M. Administrator

Joined: 08 Oct 2003 Posts: 752 Location: Greece
|
Posted: Jan 10th, 2004 04:03 PM Post subject: |
|
|
I can't get the RightToLeft Property to work either... Here is an idea that I had though, just by playing with the selstart property :
| Code: | Private Sub Text1_KeyPress(KeyAscii As Integer)
If Text1.SelStart > 0 Then
Text1.SelStart = Text1.SelStart - 1
End If
If KeyAscii = vbKeyBack Then
Text1.SelStart = Text1.SelStart + 2
End If
If KeyAscii = vbKeyReturn Then
Text1.SelStart = Len(Text1.Text)
End If
End Sub |
It's not perfect but it's a start... _________________ No one is completely useless. They can at least be an example of what to avoid. |
|
| Back to top |
|
Avis Junior Poster

Joined: 07 Oct 2003 Posts: 510 Location: India
|
|
| Back to top |
|
|