Jump to content

Guidelete Hakında


djonur007

Recommended Posts

Selamun Aleykum arkadaşlar;

Benim Guidelete komutunda bir sorum var. Kodlar aşağıda. Şimdi "aç" butonuna bastığımızda form2 açılıyor. "kapat" butonuna bastığımızda kapanıyor.

hata ise burda kapata tıkladıktan sonra tekrar aç butonuna basınca açılmıyor?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form = GUICreate("", 405, 294, 100, 218)
$Tikla1 = GUICtrlCreateButton("Aç", 128, 128, 153, 49, $WS_GROUP)
GUISetState(@SW_SHOW)

$Form2 = GUICreate("", 405, 294, 302, 218)
$Tikla2 = GUICtrlCreateButton("Kapat", 128, 128, 153, 49, $WS_GROUP)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Tikla1
_tikla1()
Case $Tikla2
_tikla2()
EndSwitch
WEnd

Func _tikla1()
GUISetState(@SW_SHOW, $Form2)
Endfunc

Func _tikla2()
GUIDelete($Form2)
Endfunc

Bu sorun nasıl çözülür?

Link to comment
Share on other sites

Basit bir şekilde aşağıdaki gibi olabilir;

Global $Form = GUICreate("", 405, 294, 100, 218)
$Tikla1 = GUICtrlCreateButton("Aç", 128, 128, 153, 49)
GUISetState(@SW_SHOW)

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3
			Exit
		Case $Tikla1
			_tikla1()
	EndSwitch
WEnd

Func _tikla1()
	GUISetState(@SW_DISABLE,$Form)
	Local $Form2 = GUICreate("", 405, 294, 302, 218)
	Local $Tikla2 = GUICtrlCreateButton("Kapat", 128, 128, 153, 49)
	GUISetState(@SW_SHOW)
	While 1
		$nMsg = GUIGetMsg()
		Switch $nMsg
			Case -3
				ExitLoop
			Case $Tikla2
				ExitLoop
		EndSwitch
	WEnd
	GUIDelete($Form2)
	GUISetState(@SW_ENABLE,$Form)
	GUISetState(@SW_RESTORE,$Form)
EndFunc   ;==>_tikla1

Kolay gelsin...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...