In order for your buttons to do anything, you need to define subroutines to call, and those subroutines should contain the Gui, Submit and GuiControl lines. Try something like this:
Code: Select all
Gui, Add, Text,, Nick name:
Gui, Add, Edit, vNickname
Gui, Add, Text,, Reason:
Gui, Add, Edit, vReason
Gui, Add, Text,, Duration:
Gui, Add, Edit, vDuration
Gui, Add, Button, gBan, Ban
Gui, Add, Button, default gAddtoList, Add to List
Gui, Add, Text,, Ban list:
Gui, Add, ListBox, vMyBanListBox
Gui, Add, Text,, Add list:
Gui, Add, ListBox, vMyListBox
Gui, Show
return
Ban:
Gui, Submit, NoHide
GuiControl,, MyBanListBox, %Nickname% %Reason% %Duration%
GuiControl,, Nickname
GuiControl,, Reason
GuiControl,, Duration
return
AddtoList:
Gui, Submit, NoHide
GuiControl,, MyListBox, %Nickname% %Reason% %Duration%
GuiControl,, Nickname
GuiControl,, Reason
GuiControl,, Duration
return
For example, when you press the button labeled "Add to list", it'll call the subroutine named AddtoList, which will save (submit) the contents of your three edit fields to their respective variables, then GuiControl will update your list box with their contents.
Edit: Here's a version for you with better positioning of elements and a separate ban list:
Code: Select all
Gui, Add, Text, x10 y10 h25, Nickname:
Gui, Add, Edit, x70 y7 w320 vNickname
Gui, Add, Text, x10 y35 h25, Reason:
Gui, Add, Edit, x70 y32 w320 vReason
Gui, Add, Text, x10 y60 h25, Duration:
Gui, Add, Edit, x70 y57 w320 vDuration
Gui, Add, Button, x95 y85 w100 h25 default gAddtoList, Add to List
Gui, Add, Button, x215 y85 w100 h25 gBan, Ban
Gui, Add, Text, x10 y120, Add list:
Gui, Add, ListBox, x10 y135 w380 h150 vMyListBox
Gui, Add, Text, x10 y295, Ban list:
Gui, Add, ListBox, x10 y310 w380 h150 vMyBanListBox
Gui, Show, w400 h468
return
AddtoList:
Gui, Submit, NoHide
GuiControl,, MyListBox, %Nickname% %Reason% %Duration%
GuiControl,, Nickname
GuiControl,, Reason
GuiControl,, Duration
return
Ban:
Gui, Submit, NoHide
GuiControl,, MyBanListBox, %Nickname% %Reason% %Duration%
GuiControl,, Nickname
GuiControl,, Reason
GuiControl,, Duration
return