Anas Posted January 23, 2015 Share Posted January 23, 2015 Hello, Is it possible to left-aligns the text in an input that is a part of a GUI created with $WS_EX_LAYOUTRTL? #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #region - GUI Create GUICreate('', 250, 100 -1, -1, -1, -1, $WS_EX_LAYOUTRTL) GUICtrlCreateInput('', 5, 5) ; Make it display Left to Right GUISetState() #endregion #region - GUI SelectLoop While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd #endregion Link to comment Share on other sites More sharing options...
Solution funkey Posted January 23, 2015 Solution Share Posted January 23, 2015 #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <EditConstants.au3> #include <WinAPI.au3> #region - GUI Create GUICreate('', 250, 100 -1, -1, -1, -1, $WS_EX_LAYOUTRTL) GUICtrlCreateInput('', 5, 5) ; Make it display Left to Right Global $hInput = GUICtrlGetHandle(-1) Global $InputStyle = _WinAPI_GetWindowLong($hInput, $GWL_STYLE) Global $InputExStyle = _WinAPI_GetWindowLong($hInput, $GWL_EXSTYLE) _WinAPI_SetWindowLong($hInput, $GWL_STYLE, BitXOR($InputStyle, $ES_RIGHT)) _WinAPI_SetWindowLong($hInput, $GWL_EXSTYLE, BitXOR($InputExStyle, 0x7000)) GUISetState() #endregion #region - GUI SelectLoop While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit EndSelect WEnd #endregion Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 23, 2015 Moderators Share Posted January 23, 2015 @funkey, where did you get the magic number 0x7000? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Anas Posted January 23, 2015 Author Share Posted January 23, 2015 @funkey, Thanks for the solution. @funkey, where did you get the magic number 0x7000? Also, why setting the required values at creation doesn't work? This works: GUICtrlCreateInput('test', 5, 5, 200, 50) GUICtrlSetStyle(-1, 1342374016, 512) This doesn't: GUICtrlCreateInput('test', 5, 5, 200, 50, 1342374016, 512) Link to comment Share on other sites More sharing options...
mvardin Posted April 8, 2015 Share Posted April 8, 2015 Hi , i have a RTL form and when i added this line to my code , all of checkboxes becomes wrong or change ... here is the image of wrong and true ... so , what can i do?! Link to comment Share on other sites More sharing options...
jguinch Posted April 8, 2015 Share Posted April 8, 2015 (edited) @Anas : yes strange, the style does not applies direclty when creating the control, but need a GUICtrlSetStyle... I'm interested to understand why to. Also, 2 other methods : GUICreate('', 250, 100 -1, -1, -1, -1, $WS_EX_LAYOUTRTL) GUICtrlCreateInput('test', 5, 5) GUICtrlSetStyle(-1, $WS_VISIBLE + $WS_CHILD, $WS_EX_CLIENTEDGE)#include <GUIConstants.au3> #include <WinAPI.au3> $hGui = GUICreate('', 250, 100) GUICtrlCreateInput('test', 5, 5) $iExStyle = _WinAPI_GetWindowLong($hGui, $GWL_EXSTYLE) _WinAPI_SetWindowLong($hGui, $GWL_EXSTYLE, BitOR($iExStyle, $WS_EX_LAYOUTRTL)) ; sets the extended style after all controls are created GUISetState() While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd Edited April 8, 2015 by jguinch Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now