How to alignment text on textbox (1 Viewer)

Falcon88

Registered User.
Local time
Today, 08:52
Joined
Nov 4, 2014
Messages
299
Hiii

How to alignment the text on a textbox based on the characters entered to it , if English use left alignment if Arabic use right alignment?
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:52
Joined
Sep 21, 2011
Messages
14,310
Test for English alphabetic character as first character.?
 

Falcon88

Registered User.
Local time
Today, 08:52
Joined
Nov 4, 2014
Messages
299
No , i use that text box to enter arabic and english words .

If the word is English the alignment must be left , if arabic it must be right alignment .
 

CJ_London

Super Moderator
Staff member
Local time
Today, 06:52
Joined
Feb 19, 2013
Messages
16,616
i use that text box to enter arabic and english words .

Unless you mean Arabic or English words, provide an example of what you mean - if you have a sentence with a mix of English and Arabic words - how do you decide?

Do you mean one user is using Arabic and another English?
Or the same user uses both on different occasions?
 

Falcon88

Registered User.
Local time
Today, 08:52
Joined
Nov 4, 2014
Messages
299
I mean some records that text box contains arabic words that read from right , while others in English words that read from left .
 

Gasman

Enthusiastic Amateur
Local time
Today, 06:52
Joined
Sep 21, 2011
Messages
14,310
I mean some records that text box contains arabic words that read from right , while others in English words that read from left .
Still none the wiser? :(

Is it all english, all arabic, or a mixture?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 13:52
Joined
May 7, 2009
Messages
19,245
you can switch language by using Alt-Shift on your keyboard.
you can see the Language bar on your Taskbar (right-most), if it changes.
now when you type, you just type it normally.

example:
(Alt-Shift) to select English
[type the english word (space) (Alt-Shift select Arabic) type the arabic word (space) (Alt-shift select English) type another english word], etc...
the orientation of the word depends on which languages was chosen before you typed the word.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:52
Joined
Feb 28, 2001
Messages
27,191
Unless you are not telling us something, the problem should be quite simple. It doesn't matter that you have Arabic or English words. It matters that they are presented in the correct font. You haven't told us enough to make it clear how you intend to discover the correct font.

If you have an ordinary Access text box, the font and reading order are not generally automatic but you can manually set both easily enough. If your problem is that the words in the box SHOULD be shown in an English font or SHOULD be shown in an Arabic font then you have to test the words so YOU can set the font and direction. You would adjust the text box properties .ReadingOrder and .Fontname based on how you want the text displayed.

If instead you have a form of "rich text" feeding the text box then you have to have an indicator in the text box data (.Value or .Text depending on what has focus at the moment) that identifies the selected font. If so, you would have to parse the text to see if you could find the font setting and make your decision accordingly.

If you are using a form of Unicode that contains both Arabic and English characters, you can test the characters because the codes for those two languages do not overlap. The difference between Arabic and English text codes would differ widely enough to be easy to test. But in that case, you would not have to adjust the font (because it is a Unicode font, assuming you could find what you wanted). You would only have to play with reading order.

Also note that there is a setting for the textbox.ReadingOrder property (=0) that if you WERE using detectable Arabic or English characters, it might be able to tell the difference and automatically set the direction for you based on the first character in the box.
 

Users who are viewing this thread

Top Bottom