Jump to content

Recommended Posts

Posted

I have a GUI and a EDIT and a Button controls in it. There is some text in the edit control and the GUI is closed when pressing the button. The issue is that if i leave the GUI and change the focus to another window(click another window) and then go back to the GUI the text is not visible as well as the custom color of the EDIT background. If i click inside the Edit and try to select. It is back to normal again.I am beginner in GUIs so lease help.

Posted

Global $hGui, $but,$Label, $iW = 500, $iH = 230, $Last ,$msg
$hGui=GUICreate('', $iW, $iH, $WS_POPUP)
GUISetBkColor(0xff0001, $hGui)
$Label = GUICtrlCreateEdit("", 0, 0, $iW, $iH-50)
GUICtrlSetFont($Label, 10, 700)
$but = GUICtrlCreateButton ('OK',0, 0,500,380)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 700)
GUISetState(@SW_SHOWNA, $hGui)
GUICtrlSetBkColor($Label,0xBFCFFF)
GUICtrlSetData ($Label,"System information : "&@CRLF&@CRLF&$strData1[0][0]&": "&$arrResults2[0][1]&@CRLF&$strData[0][0]&": "&$arrResults[0][1]&@CRLF&$strData[1][0]&": "&$arrResults[1][1]&@CRLF&$strData[2][0]&": "&$arrResults[2][1]&@CRLF&$strData[3][0]&": "&$arrResults[3][1]&@CRLF)
 While 1
        $msg = GUIGetMsg()
        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
        If $msg = $but Then ExitLoop
    WEnd
    GUIDelete()

Posted

Mayb so?

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>

Global $hGui, $but,$Label, $iW = 500, $iH = 230, $Last ,$msg

$hGui = GUICreate('', $iW, $iH, $WS_POPUP)
GUISetBkColor(0xff0001, $hGui)

$Label = GUICtrlCreateEdit("", 0, 0, $iW, $iH-50)
GUICtrlSetFont($Label, 10, 700)
GUICtrlSetBkColor($Label,0xBFCFFF)

$but = GUICtrlCreateButton ('OK', 0, 180, 500, 50)
GUICtrlSetColor(-1, 0x000000)
GUICtrlSetFont(-1, 14, 700)

GUISetState(@SW_SHOW, $hGui)

GUICtrlSetData ($Label,"System information:")

While 1
    $msg = GUIGetMsg()
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    If $msg = $but Then ExitLoop
WEnd
Posted (edited)

$but = GUICtrlCreateButton ('OK',0, 0,500,380)

$but = GUICtrlCreateButton ('OK', 0, 180, 500, 50)

So i guess my button coordinates was not correctly calculated? Is this all that was wrong in my script? And there is no "repaint the GUI with all in it function" ?

Edited by Juvigy

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
×
×
  • Create New...