Skocz do zawartoś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] Mały niedosyt wiedzy o GUI :)


Rekomendowane odpowiedzi

Opublikowano

Witam

Kod na początek.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 120, 251, 192, 124)
$Button1 = GUICtrlCreateButton("Open Form1", 8, 16, 97, 41)
$Button2 = GUICtrlCreateButton("Exit form2", 8, 64, 97, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd



;==========================Wygenerowane Form 2 

#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Form3", 322, 102, 194, 111)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd
 

 

Pytanie brzmi:D
Jak otworzyć i zamknąć Form2 ?:P

v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
 

Opublikowano

Boże -.-
To jest dla przykładu ...

Masz bo przecież zwiędniesz -.-

Przyjmijmy jeszcze niestworzony Player
$Buttonplaylist - przyjmijmy jest w naszym Playerku.
Przycisk ten miałby odpalić to :
A $GUI_EVENT_CLOSE w już otwartej PL
Zamyka Tylko PL
Czaisz M4aniak projekt ?

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <WindowsConstants.au3>
#Include <Array.au3>
#include <File.au3>
#include <ProgressConstants.au3>
global $IL1, $pack , $IL4
Global $Clean, $LI4, $List1
$Ilosc=0
$Ilosc3=$Ilosc
Dim $Song[1000]
Dim $Song2[1000]
$pack2=true
$Firstload=True


iniwrite("Player.ini","key","1","nice")
;~ $L4 = IniRead("Player.ini","Value","1","")
;~ $Song = IniReadSection("Player.ini","Folder")
;~ $Somg2= inireadsection("Player.ini","Song")


#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AmfiProject", 219, 560, 252, 145, BitOR($GUI_SS_DEFAULT_GUI,$WS_THICKFRAME))
$List1 = GUICtrlCreateList("", 0, 0, 225, 525,BitOR($LBS_NOTIFY,$WS_BORDER,$WS_VSCROLL,$LBS_MULTIPLESEL))


$Button1 = GUICtrlCreateButton("Add", 16, 520, 49, 17, $BS_NOTIFY)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button2 = GUICtrlCreateButton("Delate", 88, 520, 49, 17, $BS_NOTIFY)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button3 = GUICtrlCreateButton("Tab1", 152, 520, 49, 17, $BS_NOTIFY)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$Button4 = GUICtrlCreateButton("Tab2", 152, 540, 49, 17, $BS_NOTIFY)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit 1
		case $Button1
			Find()
		Case $Button2
			  Delete()




			 case $Button3
				 _ArrayDisplay($Song2, "Tablica:]")
			case $Button4
               _ArrayDisplay($Song, "Tablica2:]")
	EndSwitch
WEnd

func Find()
	IF $Firstload = True Then
		$Folder = FileSelectFolder("Wybierz folder.", "", 2)
		$FileList = _FileListToArray($Folder,"*.mp3")
		$IL1 = $FileList[0]
		$IL4=$IL1
$IL2=0
$IL3=0-1
			For $IL2=$IL2 to $IL1 -1
				$idx=$Il2-$IL3
			$Song[$IL2]=$Folder&"\"&$FileList[$idx]
			$Song2[$IL2]=$FileList[$idx]
		next
Listreview()
	Else
		$Folder = FileSelectFolder("Wybierz folder.", "", 2)
		$FileList = _FileListToArray($Folder,"*.mp3")
		$IL1 = $FileList[0]
		$IL5=$IL4
		$IL6=$IL1+$IL4
		$IL7=$IL5
	    $IL7=$IL7-1
			For $IL5 = $IL5 to $IL6 -1
			$idx=$IL5-$IL7
			$Song[$IL5]=$Folder&"\"&$FileList[$idx]
			$Song2[$IL5]=$FileList[$idx]
			Guictrlsetdata($List1,$Song2[$IL5])
			next
		$IL4=$IL6
		Listreview()


	EndIf
	$Firstload = False
endfunc
Func Listreview()
	Guictrlsetdata($List1,$Clean)
	$inir1=$IL4-1
		$inir=0

		For $inir=0 to $inir1
			$inir3=$inir+1
			$Resultinir =$Song2[$inir]
			$Resultinir2 =$Song[$inir]
				Guictrlsetdata($List1,$inir3&" - "&$Resultinir)
				Iniwrite("Player.ini", "Value", "" ,$IL4)
				Iniwrite("Player.ini", "Song", $inir ,$Resultinir)
				Iniwrite("Player.ini", "Folder", $inir ,$Resultinir2)
			next
	endfunc
Func Delete()
		  If Not GUICtrlRead($List1) = "" Then

			 $fyy = _GUICtrlListBox_FindInText($List1, GUICtrlRead($List1))
;~               MsgBox(0,"",$fyy)
			_ArrayDelete($Song2,$fyy)
			_ArrayDelete($Song,$fyy)
			$IL4=$IL4-1
			Listreview()
		EndIf

		  endfunc

Func wyjscie()
	exit 1
EndFunc

v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v^v
 

Opublikowano


#include <ButtonConstants.au3>

#include <GUIConstantsEx.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("Form1", 120, 251, 192, 124)

$Button1 = GUICtrlCreateButton("Open Form1", 8, 16, 97, 41)

$Button2 = GUICtrlCreateButton("Exit form2", 8, 64, 97, 41)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

 

$state = false

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

Case $Button1

if not $state Then

$state = true

$Form3 = GUICreate("Form3", 322, 102, 194, 111)

GUISetState(@SW_SHOW)

endif

Case $Button2

if $state Then

$state = false

guiDelete( $Form3 )

endif

 

EndSwitch

WEnd

WSZYSTKIE PLIKI W CHMURZE DLA MPCFORUM ZOSTAŁY USUNIĘTE. NIE KORZYSTAĆ Z MOICH PROGRAMÓW.

Proszę nie ingerować w moje posty/tematy, w razie potrzeby usunąć całą zawartość. Nie pomagam.

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...