Hello fellow coders.
Im currently making a GUI for a webapp. Im using a REST API to get information and display this in a Tree view. Its basically a scheduler of "tasks" and these tasks are great to display in a tree view.
The problem im having is that on some servers the tree can get rather large. So my GUI is reziable in ordet to be able to fit all the tasks in the view. I have then used GUICtrlSetResizing with diffrent options to get the GUI to look alright even when i resize it. It works fine an all GUI elements, except for the Tree-view. And if i remember correctly, the treeview item is another type of object and you cannot use regular GUI functions on it. Therefor im wondering of there are any alternatives?
#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiTreeView.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 208, 220, 192, 124,$WS_SIZEBOX) $idTV = _GUICtrlTreeView_Create($Form1, 4, 25, 200, 140) GUICtrlSetResizing(-1,$GUI_DOCKMENUBAR) $Button1 = GUICtrlCreateButton("Button1", 8, 168, 75, 25) GUICtrlSetResizing(-1,$GUI_DOCKSTATEBAR) $Text = GUICtrlCreateLabel("Text", 8, 8, 25, 17) GUICtrlSetResizing(-1,$GUI_DOCKMENUBAR) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd This code is an example of my problem (run it and try to resize the window). If anyone has any ideas i would appreciate it
first step i write ipconfig output to ipconfig.txt. Now i try to find all Adapters and get for each adapter: Adapter Name, Description, Media State and Mac Adress and put it to listbox. I search for "Ethernet Adapter" but they are other entrys like Wireless Adapter .. How can i get all Adapters from ipconfig.txt and information for each adapter Adapter Name, Description, Media State and Mac Adress and write to listbox ?
Would appreciate any help!
#include <File.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 451, 328, 856, 237) $Button1 = GUICtrlCreateButton("Button1", 8, 8, 75, 25) $List1 = GUICtrlCreateList("", 88, 8, 353, 305) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select ;Case $GUI_EVENT_CLOSE Case $msg = $GUI_EVENT_CLOSE Exitloop Case $msg = $Button1 $FilePath= "C:\temp\IPconfig.txt" $StringToSearch= "Ethernet adapter" $CaseSense=0 $Lines=_FileCountLines($FilePath) $hFile=FileOpen($FilePath,0) $Lines=_FileCountLines($FilePath) For $i=0 To Number($Lines) $Test=FileReadLine($hFile,$i) If StringInStr($Test,$StringToSearch,$CaseSense) Then $filereadAdapter = FileReadLine($hFile,$i) $filereadDescription = FileReadLine($hFile,$i+4) $filereadMediaState = FileReadLine($hFile,$i+2) $filereadMAcAdress = FileReadLine($hFile,$i+5) GUICtrlSetData($List1 , "Adapter: " & $filereadAdapter & @CRLF& "Description: "& $filereadDescription & @CRLF & "Media State: " & $filereadMediaState & @CRLF & "Mac Adress: " & $filereadMAcAdress& @CRLF) ;ExitLoop EndIf Next FileClose($hFile)
can we create a list box with Columns?
Dears I have a question if you let me
can we create a list box with Columns?
i know we can create a list view with Columns
but my question is about the list box
I'm waiting your responses
Thank you in advance
Today I'm working on listbox but there might be something that I'm missing...
I made a little script that allow the user to swap 2 items for the listbox. So the user select for example the 3rd item, press the button "Up" and it switch with the 2nd one, same with the "Down" button that switch with the 4th one.
But when I select the 3rd item and switch it the item become unselected and I would like to select it again after the manipulation :
As you can see in the comment of the script, _GUICtrlListBox_SetSel don't highlight/select them once the swap process is done..
What am I missing ?
I know there are listbox and listview, but now I have?
here is the video of infowindow
I tried to read mouse selection like for listbox:
$listWindow = "[CLASS:TFormResearchGR]" $topicsList = "[CLASS:TMWrapper; INSTANCE:255]" WinWait($listWindow, "", 60) $hdlWindow = WinGetHandle($listWindow) $hdlList = ControlGetHandle($hdlWindow, "", $topicsList) _GUICtrlListBox_ClickItem($hdlList, 0, "left") $countOfList = _GUICtrlListBox_GetCount($hdlList) ConsoleWrite("Count of list: " & $countOfList & @LF) count of list is not working.
I realiezed that there are difference between listbox and listview, but this is something different.
and till now I never saw that you can go inside with infotool and also get instances.
so Im confused how to get the list number and the names of selection?