Код:
#include <GUIConstants.au3>
#include <Misc.au3>
$main = GUICreate("", 206, 110, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), -1)
$start = GUICtrlCreateButton ("111",0, 0, 100, 40)
$play = GUICtrlCreateButton ("2222", 103, 0, 100, 40)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $start
colorRec()
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
Func colorRec()
GUICtrlCreateGraphic(20, 20, 90, 90)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0004)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 80, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 80, 19)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 81, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 81, 19)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 82, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 82, 19)
EndFunc
Красная линия отображается только наполовину и после второго нажатия на кнопку. А если вот так, то все работает нормально.
Код:
#include <GUIConstants.au3>
#include <Misc.au3>
$main = GUICreate("", 206, 110, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), -1)
$start = GUICtrlCreateButton ("111",0, 0, 100, 40)
$play = GUICtrlCreateButton ("2222", 103, 0, 100, 40)
GUICtrlCreateGraphic(20, 20, 90, 90)
GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFF0004)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 80, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 80, 19)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 81, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 81, 19)
GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 82, -19)
GUICtrlSetGraphic(-1, $GUI_GR_LINE, 82, 19)
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $start
colorRec()
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
EndSelect
WEnd
Func colorRec()
EndFunc
Вопрос: как сделать, чтобы линия рисовалась полностью и после первого нажатия на кнопку?