Sign in to follow this  
Followers 0
J0ker

Center text in an input

5 posts in this topic

How can I center the text in a gui input? I tried GuiCtrlSetStyle but there's no style that fit my need in the Gui control style section.

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 75,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Input_1 = GuiCtrlCreateInput("", 30, 20, 330, 30)

        GuiCtrlSetfont($Input_1,12)
        GUICtrlSetLimit($Input_1,29)
        GuiSetIcon(@AutoItExe, -1)
        GUICtrlSetStyle($Input_1 , ;HERE)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites



Hmm have you tried

$Input_1 = GuiCtrlCreateInput("", 30, 20, 330, 30, 0x0001)

Share this post


Link to post
Share on other sites

#include <GuiConstants.au3>

GuiCreate("MyGUI", 392, 200,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS))

$Input_1 = GuiCtrlCreateInput("", 30, 20, 330, 30, BitOR($ES_CENTER, $ES_MULTILINE))
GuiCtrlSetfont($Input_1,12)
GUICtrlSetLimit($Input_1,29)
GuiSetIcon(@AutoItExe, -1)
GUISetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
        ;;;
    EndSelect
WEnd


[center]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.[/center]

Share this post


Link to post
Share on other sites

$Input_1 = GuiCtrlCreateInput("", 30, 20, 330, 30, $ES_CENTER)


Sapiente vince, rex, noli vincere ferro!

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hmm have you tried

$Input_1 = GuiCtrlCreateInput("", 30, 20, 330, 30, 0x0001)

Exactly what i was looking for ! thx

Edited by J0ker

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0