SetWindowLong for RTL layout.


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: SetWindowLong for RTL layout.

  1. #1
    Sanjay Kapoor Guest

    SetWindowLong for RTL layout.


    Hello Friends.

    Issue:
    I wish to render my vb form and 2 textbox controls in RTL (right-to-left)
    layout.

    So I set WS_EX_LAYOUTRTL for each of them as:

    SetWindowLong (ControlHWnd, GWL_EXSTYLE, lOrig Or WS_EX_LAYOUTRTL)
    ' called three time; once for Form and twice for the two controls
    ' lOrig here is the original GWL_EXSTYLE for a control


    Problem:
    I key in something in text1. It is RTL fine!
    Tab Out. Tab In again into Text1.
    Guess what... RTL becomes LTR!
    But if I select the text or modify it, RTL is restored.

    Is something amiss somewhere?

    Thanks in advance,

    Best Regards
    Sanjay.


  2. #2
    Jonathan Wood Guest

    Re: SetWindowLong for RTL layout.

    I don't have a direct answer to this but I can tell you that some window
    sytles don't like to be changed once the window is created. Such styles are
    difficult to control in VB since VB doesn't normally allow you to control
    the window-creation process.

    Just a thought.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com
    "Sanjay Kapoor" <san_kapoor@indiatimes.com> wrote in message
    news:3d5184d7$1@10.1.10.29...
    >
    > Hello Friends.
    >
    > Issue:
    > I wish to render my vb form and 2 textbox controls in RTL (right-to-left)
    > layout.
    >
    > So I set WS_EX_LAYOUTRTL for each of them as:
    >
    > SetWindowLong (ControlHWnd, GWL_EXSTYLE, lOrig Or WS_EX_LAYOUTRTL)
    > ' called three time; once for Form and twice for the two controls
    > ' lOrig here is the original GWL_EXSTYLE for a control
    >
    >
    > Problem:
    > I key in something in text1. It is RTL fine!
    > Tab Out. Tab In again into Text1.
    > Guess what... RTL becomes LTR!
    > But if I select the text or modify it, RTL is restored.
    >
    > Is something amiss somewhere?
    >
    > Thanks in advance,
    >
    > Best Regards
    > Sanjay.
    >




  3. #3
    Karl E. Peterson Guest

    Re: SetWindowLong for RTL layout.

    One of the best BB's written:

    http://www.devx.com/premier/mgznarch...l99/bb0799.pdf

    (Yes, it's free, even though it says premier.)

    Later... Karl
    --
    [Microsoft Basic: 1976-2001, RIP]


    "Jonathan Wood" <jwood@softcircuits.com> wrote in message news:3d51874f@10.1.10.29...
    > I don't have a direct answer to this but I can tell you that some window
    > sytles don't like to be changed once the window is created. Such styles are
    > difficult to control in VB since VB doesn't normally allow you to control
    > the window-creation process.
    >
    > Just a thought.
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    > "Sanjay Kapoor" <san_kapoor@indiatimes.com> wrote in message
    > news:3d5184d7$1@10.1.10.29...
    > >
    > > Hello Friends.
    > >
    > > Issue:
    > > I wish to render my vb form and 2 textbox controls in RTL (right-to-left)
    > > layout.
    > >
    > > So I set WS_EX_LAYOUTRTL for each of them as:
    > >
    > > SetWindowLong (ControlHWnd, GWL_EXSTYLE, lOrig Or WS_EX_LAYOUTRTL)
    > > ' called three time; once for Form and twice for the two controls
    > > ' lOrig here is the original GWL_EXSTYLE for a control
    > >
    > >
    > > Problem:
    > > I key in something in text1. It is RTL fine!
    > > Tab Out. Tab In again into Text1.
    > > Guess what... RTL becomes LTR!
    > > But if I select the text or modify it, RTL is restored.
    > >
    > > Is something amiss somewhere?
    > >
    > > Thanks in advance,
    > >
    > > Best Regards
    > > Sanjay.
    > >

    >
    >



  4. #4
    Jonathan Wood Guest

    Re: SetWindowLong for RTL layout.

    Yep, a bit of a hassle but definitely a useful technique when you need it.

    I must've missed that one. Thanks!

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    "Karl E. Peterson" <karl@mvps.org> wrote in message
    news:3d5191ea@10.1.10.29...
    > One of the best BB's written:
    >
    > http://www.devx.com/premier/mgznarch...l99/bb0799.pdf
    >
    > (Yes, it's free, even though it says premier.)
    >
    > Later... Karl
    > --
    > [Microsoft Basic: 1976-2001, RIP]
    >
    >
    > "Jonathan Wood" <jwood@softcircuits.com> wrote in message

    news:3d51874f@10.1.10.29...
    > > I don't have a direct answer to this but I can tell you that some window
    > > sytles don't like to be changed once the window is created. Such styles

    are
    > > difficult to control in VB since VB doesn't normally allow you to

    control
    > > the window-creation process.
    > >
    > > Just a thought.
    > >
    > > --
    > > Jonathan Wood
    > > SoftCircuits Programming
    > > http://www.softcircuits.com
    > > "Sanjay Kapoor" <san_kapoor@indiatimes.com> wrote in message
    > > news:3d5184d7$1@10.1.10.29...
    > > >
    > > > Hello Friends.
    > > >
    > > > Issue:
    > > > I wish to render my vb form and 2 textbox controls in RTL

    (right-to-left)
    > > > layout.
    > > >
    > > > So I set WS_EX_LAYOUTRTL for each of them as:
    > > >
    > > > SetWindowLong (ControlHWnd, GWL_EXSTYLE, lOrig Or WS_EX_LAYOUTRTL)
    > > > ' called three time; once for Form and twice for the two controls
    > > > ' lOrig here is the original GWL_EXSTYLE for a control
    > > >
    > > >
    > > > Problem:
    > > > I key in something in text1. It is RTL fine!
    > > > Tab Out. Tab In again into Text1.
    > > > Guess what... RTL becomes LTR!
    > > > But if I select the text or modify it, RTL is restored.
    > > >
    > > > Is something amiss somewhere?
    > > >
    > > > Thanks in advance,
    > > >
    > > > Best Regards
    > > > Sanjay.
    > > >

    > >
    > >

    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center