Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region
- #AutoIt3Wrapper_UseUpx=Y
- #AutoIt3Wrapper_Compression=4
- #AutoIt3Wrapper_Icon=E:\wamp\www\favicon.ico
- #AutoIt3Wrapper_Res_Comment=Coded by Juno_okyo
- #AutoIt3Wrapper_Res_Description=Coded by Juno_okyo
- #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
- #AutoIt3Wrapper_Res_LegalCopyright=(c) 2014 by Juno_okyo's Blog
- #AutoIt3Wrapper_Res_Field=ProductName|Juno_okyo's Production
- #AutoIt3Wrapper_Res_Field=ProductVersion|1.0.0.0
- #AutoIt3Wrapper_Res_Field=CompanyName|J2TeaM
- #AutoIt3Wrapper_Res_SaveSource=N
- #endregion
- ; Includes
- #include <Misc.au3>
- #include <ButtonConstants.au3>
- #include <GUIConstantsEx.au3>
- #include <ListViewConstants.au3>
- #include <WindowsConstants.au3>
- #include <GuiListView.au3>
- ; Only One Instance
- _Singleton(@ScriptName)
- ; Options
- #NoTrayIcon
- Opt('WinTitleMatchMode', 2)
- Opt('GUIOnEventMode', 1)
- Opt('GUICloseOnESC', 0)
- ; Script Start - Add your code below here
- #Region ### START Koda GUI section ### Form=
- Global $MainForm = GUICreate("Demo by Juno_okyo", 250, 236, -1, -1)
- GUISetFont(12, 400, 0, "Arial")
- GUISetOnEvent($GUI_EVENT_CLOSE, "MainFormClose")
- Global $ListView1 = GUICtrlCreateListView("User", 5, 5, 240, 185)
- _GUICtrlListView_SetColumnWidth(-1, 0, 235)
- GUICtrlCreateListViewItem("juno_okyo", $ListView1)
- GUICtrlCreateListViewItem("test", $ListView1)
- GUICtrlCreateListViewItem("admin", $ListView1)
- Global $Button1 = GUICtrlCreateButton("Add Item", 5, 200, 87, 25)
- GUICtrlSetOnEvent(-1, "AddBtn")
- GUICtrlSetCursor(-1, 0)
- Global $Button2 = GUICtrlCreateButton("Edit", 104, 200, 75, 25)
- GUICtrlSetOnEvent(-1, "EditBtn")
- GUICtrlSetCursor(-1, 0)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- While 1
- Sleep(100)
- WEnd
- Func AddBtn()
- Local $item = InputBox('Add Item', 'Enter an item:')
- If $item <> '' Then
- GUICtrlCreateListViewItem($item, $ListView1)
- EndIf
- EndFunc
- Func EditBtn()
- Local $item = _GUICtrlListView_GetSelectedIndices($ListView1)
- Local $index = Int($item)
- Local $text = _GUICtrlListView_GetItemText($ListView1, $index)
- Local $new_text = InputBox('Edit Item', 'Enter a new value:', $text)
- _GUICtrlListView_SetItemText($ListView1, $index, $new_text)
- EndFunc
- Func MainFormClose()
- Exit
- EndFunc
Add Comment
Please, Sign In to add comment