Page 1 of 1

TextBox RTL

Posted: 25 Jul 2011, 16:03
by TickTick
Hi Timo,

sorry, I am confused...

Can you please check if this is a bug? The RTL layout and text is not changed back to LTR after the first click on my button...
Even settings TextBox1.RightToLeft = 0 does not change it.
Is this my fault?

Option Explicit

Private Sub Form_Load()

Me.TextBox1.Move 0, 0, 4000, 4000
Me.TextBox1.AutoScrolling = asVertical
Me.TextBox1.ScrollBars = sbVertical
Me.TextBox1.Text = "jkasdjf öasjdfklas flökajsfl kjasölfkj aslköfjas lkjflökasdj flkasjdl öfkjaslköfj aslköjf aslökjflökasjf lkasöjf lasjöf asjdfölasj flökasjf asjflökjas lfjasl ökfj asöljf lkasdjföla sjflökjaslfökjaslkfj aslöjf lk asj dföl jaslökdfjasölkjf lkas jflasjf ljasföljas flköjaslköfj aslökfj asf jasl öjflköasjd f ölasj f ölasj fdkslf"

End Sub

Private Sub Command1_Click()

Static bRTL As Boolean
bRTL = Not bRTL

If bRTL Then
If Me.TextBox1.RightToLeft <> (rtlLayout Or rtlText) Then
Me.TextBox1.RightToLeft = (rtlLayout Or rtlText)
End If
Else
If Me.TextBox1.RightToLeft <> 0 Then
Me.TextBox1.RightToLeft = (Not rtlLayout) And (Not rtlText)
End If
End If

End Sub

Re: TextBox RTL

Posted: 25 Jul 2011, 16:07
by TickTick
Or even simpler code to check (please use on button click):

If Me.TextBox1.RightToLeft = 0 Then
Me.TextBox1.RightToLeft = 3
Else
Me.TextBox1.RightToLeft = 0
End If

Re: TextBox RTL

Posted: 26 Jul 2011, 07:35
by TiKu
Hi,

I can reproduce this problem and am working on a fix.

TiKu

Re: TextBox RTL

Posted: 27 Jul 2011, 05:32
by TickTick
Thank you very much!

Re: TextBox RTL

Posted: 29 Jul 2011, 23:11
by TiKu
Hi,

See the attachment.

Regards
TiKu

Re: TextBox RTL

Posted: 02 Aug 2011, 17:32
by TickTick
Hi Timo,

thank you very much!
Do you consider this a production release?
I mean, can I use it in real life or should I do lots of beta testing?

Greetings!

Re: TextBox RTL

Posted: 02 Aug 2011, 20:06
by TiKu
The fixed RightToLeft property so far is the only change compared to the last public release. Previously changing the RightToLeft property did not always recreate the control window (which also means that the control gets a new hWnd). Instead it just changed window styles in some situations. This must have been working fine on Windows XP (I developed this control on Windows XP), but obviously it did not work on Windows Vista/7. Now the control always recreates the control window.
I don't know your software, but I doubt it will have problems that are caused by this change.

Re: TextBox RTL

Posted: 03 Aug 2011, 07:27
by TickTick
Okay, thank you very much!

Re: TextBox RTL

Posted: 15 Aug 2011, 21:30
by TiKu
Hi,

For Windows Vista and 7 I've found another solution which seems to be better because it does not require to recreate the control window. Version 1.6.2.149 which I just released a few minutes ago contains this solution.

Regards
Timo