TextBox RTL

The place for threads about TimoSoft EditControls.
Post Reply
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

TextBox RTL

Post 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
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TextBox RTL

Post 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
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TextBox RTL

Post by TiKu »

Hi,

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

TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TextBox RTL

Post by TickTick »

Thank you very much!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TextBox RTL

Post by TiKu »

Hi,

See the attachment.

Regards
TiKu
Attachments
editctls162148-rel.zip
EditControls 1.6.2 pre-release
(1.66 MiB) Downloaded 456 times
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TextBox RTL

Post 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!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TextBox RTL

Post 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.
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
TickTick
Lt. Commander
Posts: 54
Joined: 17 Feb 2009, 01:41

Re: TextBox RTL

Post by TickTick »

Okay, thank you very much!
User avatar
TiKu
Administrator
Administrator
Posts: 832
Joined: 28 Sep 2004, 21:10
Location: München
Contact:

Re: TextBox RTL

Post 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
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Post Reply