Jump to content

Center text in an input


 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

#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

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...