Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
Visual Basic Forum for Visual Basic Programmers VB Forum Index » General

Post new topic   Reply to topic
Right-to-left Text Box Control??
View previous topic :: View next topic  
Author Message
szewari
Newbie


Joined: 08 Jan 2004
Posts: 1

PostPosted: Jan 8th, 2004 05:38 PM    Post subject: Right-to-left Text Box Control?? Reply with quote

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
View user's profile Send private message Send e-mail
Andir
Centurion


Joined: 21 Dec 2003
Posts: 184
Location: Chicago Area

PostPosted: Jan 9th, 2004 12:33 PM    Post subject: Reply with quote

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
View user's profile Send private message
P.T.A.M.
Administrator


Joined: 08 Oct 2003
Posts: 752
Location: Greece

PostPosted: Jan 10th, 2004 04:03 PM    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website ICQ Number
Avis
Junior Poster


Joined: 07 Oct 2003
Posts: 510
Location: India

PostPosted: Jan 11th, 2004 03:53 AM    Post subject: Reply with quote

Hi!

I think the RightToLeft property is for systems which have that language installed when we install Windows and select the language and this may not work on the english language and other.

Thanks!
_________________
Code Snippets, Tutorials, Utilities, Controls

Low cost Web Hosting
Hosting starts at as low as $4 per year!


Always follow posting guidelines
Put your VB code in [vb ] your code [ /vb] tags!
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger ICQ Number
Display posts from previous:   
Post new topic   Reply to topic    Visual Basic Forum for Visual Basic Programmers VB Forum Index » General All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Visual Basic Forum runs phpBB | Forum Template © iOptional
VB Resources | SSL | Visual Basic