Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

[Pytanie] 2X Gui.

Rekomendowane odpowiedzi

Opublikowano

Siemka.

 

Chcę zrobić, właściwie mam już zrobione proste GUI pierwsze, startowe..

I chcę, żeby po kliknięciu buttona wyświetlało się kolejne GUI inne od tamtego..

 

GUICtrlDelete()
... ; część 2 gui...

 

Ale wywala mi błąd:

 

 Variable used without being declared.:
Case $gui2
Case ^ ERROR

 

WTF?

Opublikowano

Zmienna gui2 została użyta bez wcześniejszej deklaracji ;>

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano
  • Autor

Woow ;d

No co ty ?

Nie wiedziałem o tym dzięki xD

 

Jest zdeklarowana jako Case...

 

		

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit

	Case $gui2

		GUIDelete()

		#Region ### START Koda GUI section ### Form=
		$Form = GUICreate("Hideramer - GUI", 286, 164, 330, 190)
		$input = GUICtrlCreateInput("", 24, 32, 121, 21)
		$Label3 = GUICtrlCreateLabel("Window name:", 24, 8, 75, 17)
		$show2 = GUICtrlCreateButton("Show", 184, 16, 75, 25)
		$hide2 = GUICtrlCreateButton("Hide", 184, 48, 75, 25)
		$kill2 = GUICtrlCreateButton("Kill", 184, 80, 75, 25)
		GUICtrlSetColor(-1, 0xFF0000)
		$Button4 = GUICtrlCreateButton("Rename", 184, 112, 75, 25)
		GUICtrlCreateInput("", 24, 112, 121, 21)
		GUISetState(@SW_SHOW)
		#EndRegion ### END Koda GUI section ###

		$nazwa = GUICtrlRead($input)

	Case $show2
		WinSetState ($nazwa, "", @SW_SHOW)

	Case $hide2
		WinSetState ($nazwa, "", @SW_HIDE)

EndSwitch
WEnd

Opublikowano

brak słów....

 

 

Poczytaj o funkcji Case

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano
  • Autor

@up

 

Chyba o Tobie ;d

 

Masz cały kod..

Przeanalizuj go sobie...

I powiedz dlaczego nie działa..

 

Tamto wyrwałem z kontekstu :D

 

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$hotkey = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit

	Case $hotkey
		GUIDelete()
		$nazwa = InputBox ( "", "F2 to Hide" & @LF & "F3 to Show" & @LF & "F4 to Rename window" & @LF & "ESC to Exit" & @LF & @LF & "Write window name:" )

		If WinExists($nazwa) Then

		Else
			TrayTip ("", "Window not exists.. Ending..", 3)
			Sleep ( 3100 )
			Exit
		EndIf

		HotKeySet ("{F2}", "hide")
		HotKeySet ("{F3}", "show")
		HotKeySet ("{F4}", "nazwa")
		HotKeySet ("{ESC}", "koniec")

		Func show()
		WinSetState ( $nazwa, "", @SW_RESTORE )
		EndFunc

		Func hide()
			WinSetState ( $nazwa, "", @SW_HIDE )
		EndFunc

		Func nazwa()
			$newnazwa = InputBox ( "", "New name of window?")
			WinSetTitle ( $nazwa, "", $newnazwa)
			$nazwa = $newnazwa
			TrayTip ("", "New window name is: " & $newnazwa, 3)
		EndFunc

		Func koniec()
			Exit
		EndFunc

	Case $gui2

		GUIDelete()

		#Region ### START Koda GUI section ### Form=
		$Form = GUICreate("", 286, 164, 330, 190)
		$input = GUICtrlCreateInput("", 24, 32, 121, 21)
		$Label3 = GUICtrlCreateLabel("Window name:", 24, 8, 75, 17)
		$Button1 = GUICtrlCreateButton("Show", 184, 16, 75, 25)
		$Button2 = GUICtrlCreateButton("Hide", 184, 48, 75, 25)
		$Button3 = GUICtrlCreateButton("Kill", 184, 80, 75, 25)
		GUICtrlSetColor(-1, 0xFF0000)
		$Button4 = GUICtrlCreateButton("Rename", 184, 112, 75, 25)
		GUICtrlCreateInput("", 24, 112, 121, 21)
		GUISetState(@SW_SHOW)
		#EndRegion ### END Koda GUI section ###

		$nazwa = GUICtrlRead($input)

	Case $show2
		WinSetState ($nazwa, "", @SW_SHOW)

	Case $hide2
		WinSetState ($nazwa, "", @SW_HIDE)

EndSwitch
WEnd

 

Opublikowano

hmm, dziwne, spróbuj na początku dać 'Global $gui2 = 0'

 

 

PS.

 

Case to typ zmiennej ?

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano
  • Autor

@up

 

Keee?

 

Nie działa..

 

A zobacz.

bez 2 gui działa ;d :

 

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$hotkey = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit

               Case $hotkey
                       GUIDelete()
                       $nazwa = InputBox ( "", "F2 to Hide" & @LF & "F3 to Show" & @LF & "F4 to Rename window" & @LF & "ESC to Exit" & @LF & @LF & "Write window name:" )

                       If WinExists($nazwa) Then

                       Else
                               TrayTip ("", "Window not exists.. Ending..", 3)
                               Sleep ( 3100 )
                               Exit
                       EndIf

                       HotKeySet ("{F2}", "hide")
                       HotKeySet ("{F3}", "show")
                       HotKeySet ("{F4}", "nazwa")
                       HotKeySet ("{ESC}", "koniec")

                       Func show()
                       WinSetState ( $nazwa, "", @SW_RESTORE )
                       EndFunc

                       Func hide()
                               WinSetState ( $nazwa, "", @SW_HIDE )
                       EndFunc

                       Func nazwa()
                               $newnazwa = InputBox ( "", "New name of window?")
                               WinSetTitle ( $nazwa, "", $newnazwa)
                               $nazwa = $newnazwa
                               TrayTip ("", "New window name is: " & $newnazwa, 3)
                       EndFunc

                       Func koniec()
                               Exit
                       EndFunc

       EndSwitch
WEnd

 

Opublikowano

Jedyne co mi przychodzi do głowy to to że GuiDelete usuwa wartości niektórych zmiennych.(?)

A moze wartośc zmiennej jest odczytywana za każdym jej użyciem, czyli za każdym użyciu zmiennej gui 2 jest pobierany handle do buttona, lecz gdy usuniesz gui to wtedy nie będzie działao

 

Żeby to ominąc musisz po usunieciu gui metodą gui delete zadeklarowac $gui = 0.

 

 

 

Case $gui2
guidelete();
$gui2 = 0
<twój kod>

 

 

 

Swoją drogą wywal funkcje za pętle !

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano

 

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$hotkey = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
	Case $GUI_EVENT_CLOSE
		Exit

	Case $hotkey
		GUIDelete()
		$nazwa = InputBox ( "", "F2 to Hide" & @LF & "F3 to Show" & @LF & "F4 to Rename window" & @LF & "ESC to Exit" & @LF & @LF & "Write window name:" )

		If WinExists($nazwa) Then

		Else
			TrayTip ("", "Window not exists.. Ending..", 3)
			Sleep ( 3100 )
			Exit
		EndIf

		HotKeySet ("{F2}", "hide")
		HotKeySet ("{F3}", "show")
		HotKeySet ("{F4}", "nazwa")
		HotKeySet ("{ESC}", "koniec")

	Case $gui2

		GUIDelete()

		#Region ### START Koda GUI section ### Form=
		$Form = GUICreate("", 286, 164, 330, 190)
		$input = GUICtrlCreateInput("", 24, 32, 121, 21)
		$Label3 = GUICtrlCreateLabel("Window name:", 24, 8, 75, 17)
		$Button1 = GUICtrlCreateButton("Show", 184, 16, 75, 25)
		$Button2 = GUICtrlCreateButton("Hide", 184, 48, 75, 25)
		$Button3 = GUICtrlCreateButton("Kill", 184, 80, 75, 25)
		GUICtrlSetColor(-1, 0xFF0000)
		$Button4 = GUICtrlCreateButton("Rename", 184, 112, 75, 25)
		GUICtrlCreateInput("", 24, 112, 121, 21)
		GUISetState(@SW_SHOW)
		#EndRegion ### END Koda GUI section ###

		$nazwa = GUICtrlRead($input)

;~ 		Case $show2
;~ 			WinSetState ($nazwa, "", @SW_SHOW)

;~ 		Case $hide2
;~ 			WinSetState ($nazwa, "", @SW_HIDE)

EndSwitch
WEnd

		Func show()
		WinSetState ( $nazwa, "", @SW_RESTORE )
		EndFunc

		Func hide()
			WinSetState ( $nazwa, "", @SW_HIDE )
		EndFunc

		Func nazwa()
			$newnazwa = InputBox ( "", "New name of window?")
			WinSetTitle ( $nazwa, "", $newnazwa)
			$nazwa = $newnazwa
			TrayTip ("", "New window name is: " & $newnazwa, 3)
		EndFunc

		Func koniec()
			Exit
		EndFunc

 

 

Whateva dude.

Ta sygnatura jest pusta.

Opublikowano
  • Autor

@up

 

Aha fajnie..

 

Tylko nie mogę żadnych Case umieścić w tym 2 GUI ;d

 

;~              Case $show2
;~                      WinSetState ($nazwa, "", @SW_SHOW)

;~              Case $hide2
;~                      WinSetState ($nazwa, "", @SW_HIDE)

 

Super pomoc ;d

Opublikowano

Możesz...

Tylko, że tych elementów ($show2 i $hide2) nie ma stworzonych :)

Chodzi Ci chyba o te buttony na 2. Formie ;] Zmień $Button1 na $show2 i $Button2 na $hide2

Opublikowano

hehehehehe xD No weźże MEeeenn <lol> Jakie przykłady?????? No plysssssssss Cie zią <lol><lol666> hehehehehe xD xD

W Helpie masz Meeen wszystko czego tylko plsssssssisz Meeen!! hehehe xD xD <lol>

Opublikowano

Może odpowiem na twoje pierwszy pytanie w temacie..

A więc gdy masz jakiś tam kod przykładowo

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit

 

No to po prostu dodajesz

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit
Case $button1
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

I piszesz co ona ma robić czyli wklejasz tu drugie gui albo jak kto woli

LAYOUT'Y POD SERWER MINECRAFT U MNIE. ZAPRASZAM PW

Opublikowano

hehehehehe xD No weźże MEeeenn <lol> Jakie przykłady?????? No plysssssssss Cie zią <lol><lol666> hehehehehe xD xD

W Helpie masz Meeen wszystko czego tylko plsssssssisz Meeen!! hehehe xD xD <lol>

 

Za pierwszym razem, baa, nawet za 3 i 4, było to śmieszne, ale jak człowiek widzi to już 100 raz to jest to wkurwiające.

 

 

 

Ty tylko chujowe rozwiązania noobków...

GUIRegisterMsg...

 

 

Chujowy to jesteś ty panie pro elo programisto.

 

Nie tak dawno sam tego używałeś, to że ktoś jest początkujący to nie znaczy że jest noobem.

liczylem na barce lecz ona niemogla wygrac.

Przez kibicow ktorzy przy rzutach roznych wolnych swiecili w messiego laserami

Opublikowano

Może odpowiem na twoje pierwszy pytanie w temacie..

A więc gdy masz jakiś tam kod przykładowo

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit

 

No to po prostu dodajesz

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
               Case $GUI_EVENT_CLOSE
                       Exit
Case $button1
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("", 229, 144)
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

I piszesz co ona ma robić czyli wklejasz tu drugie gui albo jak kto woli

Chuj mnie trafi!!!

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("1", 229, 144)
GUISetOnEvent($GUI_EVENT_CLOSE, "ex")
$button1 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
GUICtrlSetOnEvent(-1, "_x")
$gui2 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label1 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label2 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_SHOW)

$Form2 = GUICreate("2", 229, 144)
GUISetOnEvent($GUI_EVENT_CLOSE, "ex")
$button2 = GUICtrlCreateButton("Start", 77, 32, 75, 25)
$gui3 = GUICtrlCreateButton("Start", 77, 99, 75, 25)
$label4 = GUICtrlCreateLabel("Hotkey", 95, 8, 38, 17)
$label5 = GUICtrlCreateLabel("Gui", 104, 80, 20, 17)
GUISetState(@SW_HIDE)

#EndRegion ### END Koda GUI section ###
Func _x()
GUISetState(@SW_HIDE, $Form1)
GUISetState(@SW_SHOW, $Form2)
EndFunc   ;==>_x
Func ex()
Exit
EndFunc   ;==>ex
While 1
Sleep(100)
WEnd

Dla mnie najlepsze OnEvent :P

za duża sygnatura

Ostatnio przeglądający 0

  • Brak zarejestrowanych użytkowników przeglądających tę stronę.

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.