Sign in to follow this  
Followers 0
johnmcloud

Add Checkbox(s) in a GUI List

18 posts in this topic

#1 ·  Posted (edited)

Hi guys,

I have this script:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Form1", 248, 180)
$Edit = GUICtrlCreateEdit("", 8, 8, 233, 121)
$Button = GUICtrlCreateButton("Save", 8, 136, 233, 33)
GUISetState(@SW_SHOW)

$TestFile = @WorkingDir & "Test.txt"
FileOpen($TestFile, 2)
FileWrite($TestFile, "Word_1" & @CRLF & "Word_2" & @CRLF & "Word_3" & @CRLF & "Word_4")
GUICtrlSetData($Edit, FileRead($TestFile))

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
     FileDelete(@WorkingDir & "Result.txt")
     FileWrite(@WorkingDir & "Result.txt", GUICtrlRead($Edit))
     ShellExecute(@WorkingDir & "Result.txt") EndSwitch
WEnd

I don't know how, i'd like to add a checkbox on every line of this list, so if i unchecked some and click on the button it save only the element with the checkbox enabled. I don't know how hany line has .txt, but i think we can read by array[0]

Hope I was clear, if not just ask and I'll try to post more information.

Thanks ;)

Edited by johnmcloud

Share this post


Link to post
Share on other sites



Not possible in an Edit control, you can do it in a ListView control though.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Can you provide a simple script example like mine? It's better for me to understand. I think i can integrate a listview control in a GUI, right?

Thanks for your time.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Below is a ruff script of what you could do. It gets buggy when you start scrolling, but there is a probably a workaround.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include<array.au3>
$Form1 = GUICreate("Form1", 248, 180)
$Edit = GUICtrlCreateEdit("", 20, 8, 233, 121)
$Button = GUICtrlCreateButton("Save", 8, 136, 233, 33)

Local $iBoxes,$aBoxes[1], $sMSG, $iLines=1

GUISetState(@SW_SHOW)




GUICtrlSetData($Edit,"a"&@crlf&"b"&@crlf&"c"&@crlf)



While 1
$nMsg = GUIGetMsg()

$aLines=StringRegExp(GUICtrlRead($Edit),"(.*)?(?:v)?",3)

$iLines=UBound($aLines)

$iBoxes= UBound($aBoxes)
If $iBoxes>$iLines Then
For $x=$iLines To UBound($aBoxes)-1
GUICtrlDelete($aBoxes[$x])
Next
EndIf

ReDim $aBoxes[$iLines]
If $iBoxes<$iLines Then
For $x=$iBoxes To UBound($aBoxes)-1
$aBoxes[$x-1]=GUICtrlCreateCheckbox("",2,($x-1)*14+8,14)
GUICtrlSetState(-1,$GUI_CHECKED)
Next

EndIf


Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Edit

Case $Button
$sMSG=""
$aEdit=StringRegExp(GUICtrlRead($Edit),"(.*)?(?:v)?",3)


For $x=0 To UBound($aBoxes)-1

If BitAnd(GUICtrlRead ($aBoxes[$x]),$GUI_CHECKED) Then

$sMSG&=$aEdit[$x]
EndIf
Next
MsgBox (0,"",$sMSG)
EndSwitch

WEnd
Edited by DicatoroftheUSA

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

Ok guys, for now i have make this:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>

Dim $item[6] = [5]

GUICreate("Example", 216, 201, -1, -1, -1, $WS_EX_ACCEPTFILES)
$listview = GUICtrlCreateListView("Name1", 10, 10, 192, 150, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 185)
$item[1] = GUICtrlCreateListViewItem("Select/Unselect All", $listview)
$item[2] = GUICtrlCreateListViewItem("Word1", $listview)
$item[3] = GUICtrlCreateListViewItem("Word2", $listview)
$item[4] = GUICtrlCreateListViewItem("Word3", $listview)
$item[5] = GUICtrlCreateListViewItem("Word4", $listview)
$button = GUICtrlCreateButton("Save", 11, 162, 186, 20)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
For $i = 1 To $item[0]
    If BitAND(GUICtrlRead($item[$i], 1), $GUI_CHECKED) Then
     FileDelete(@WorkingDir & "Test.txt")
     FileWrite(@WorkingDir & "Test.txt", StringTrimRight(GUICtrlRead($item[$i]),1))
     ShellExecute(@WorkingDir & "Test.txt")
;~   MsgBox(0, 0, GUICtrlRead($item[$i]), 2)
    EndIf EndIf
Next
EndSwitch
WEnd

There are a couple of problems:

1) This script not read the information from a file, the problem is not how to do, but i don't know how many item has the file. In the example are 4, but may be even 500

2) Click on checkbox "Select/Unselect All" and make it working, so if is selected, all are selected and viceversa

Thanks to all ;)

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

I have resolved for the Select/Unselect all

Case $item[1]
For $i = 2 To $item[0]
If BitAND(GUICtrlRead($item[1], 1), $GUI_CHECKED) Then
     GUICtrlSetState($item[$i], $GUI_CHECKED)
Else
     GUICtrlSetState($item[$i], $GUI_UNCHECKED)
EndIf
Next

But sometime seems not work...if you click fast.

And this part not work:

If BitAND(GUICtrlRead($item[$i], 1), $GUI_CHECKED) Then
     FileDelete(@WorkingDir & "Test.txt")
     FileWrite(@WorkingDir & "Test.txt", StringTrimRight(GUICtrlRead($item[$i]), 1))
     ShellExecute(@WorkingDir & "Test.txt")
;~   MsgBox(0, 0, GUICtrlRead($item[$i]), 2)
EndIf

And i need also only to know how read an unknow number of line from a txt...

Please some advice/example

Thanks

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Not work:

Case $button
For $i = 1 To $item[0]
     If _GUICtrlListView_GetItemChecked($listview, $i-1) Then
         FileDelete(@WorkingDir & "Test.txt")
         FileWrite(@WorkingDir & "Test.txt", StringTrimRight(GUICtrlRead($item[$i]), 1))
     EndIf
Next
ShellExecute(@WorkingDir & "Test.txt")

The .txt has only one element also if if select more, so if i select one work, but two or more not...

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

This works for me...

Also for me, but when i write on a file i have only one value. I need to use FileWrite?

For $i = 1 To $item[0]
     If _GUICtrlListView_GetItemChecked($listview, $i - 1) Then
         FileDelete(@WorkingDir & "Test.txt")
         FileWrite(@WorkingDir & "Test.txt", _GUICtrlListView_GetItemText($listview, $i - 1) & @CRLF)
     EndIf
Next
ShellExecute(@WorkingDir & "Test.txt")
Edited by johnmcloud

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Thanks Zedna, update:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>

Dim $item[6] = [5]

GUICreate("Example", 216, 201, -1, -1, -1, $WS_EX_ACCEPTFILES)
$iListView = GUICtrlCreateListView("Name1", 10, 10, 192, 150, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 185)
$hListView = GUICtrlGetHandle($iListView)
$item[1] = GUICtrlCreateListViewItem("Select/Unselect All", $iListView)
$item[2] = GUICtrlCreateListViewItem("Word1", $iListView)
$item[3] = GUICtrlCreateListViewItem("Word2", $iListView)
$item[4] = GUICtrlCreateListViewItem("Word3", $iListView)
$item[5] = GUICtrlCreateListViewItem("Word4", $iListView)
$button = GUICtrlCreateButton("Save", 11, 162, 186, 20)
GUISetState(@SW_SHOW)

For $i = 1 To $item[0]
GUICtrlSetState($item[$i], $GUI_CHECKED)
Next

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $button
FileOpen(@WorkingDir & "Test.txt", 2)
For $i = 2 To $item[0]
    If _GUICtrlListView_GetItemChecked($iListView, $i - 1) Then
     FileWrite(@WorkingDir & "Test.txt", _GUICtrlListView_GetItemText($iListView, $i - 1) & @CRLF)
    EndIf
Next
If _GUICtrlListView_AllUnChecked($hListView) = True Then
    MsgBox(0, 0, "No element(s) selected")
Else
    ShellExecute(@WorkingDir & "Test.txt")
EndIf
Case $item[1]
For $i = 2 To $item[0]
    If BitAND(GUICtrlRead($item[1], 1), $GUI_CHECKED) Then
     GUICtrlSetState($item[$i], $GUI_CHECKED)
    Else
     GUICtrlSetState($item[$i], $GUI_UNCHECKED)
    EndIf
Next
EndSwitch
WEnd

Func _GUICtrlListView_AllUnChecked($hListView)
Local $iChecked = 0, $iCount = _GUICtrlListView_GetItemCount($hListView)
For $i = 0 To $iCount - 1
If Not _GUICtrlListView_GetItemChecked($hListView, $i) Then
$iChecked += 1
EndIf
Next
Return $iChecked = $iCount ; Returns True - all items are unchecked or False - some are unchecked.
EndFunc ;==>_GUICtrlListView_AllUnChecked

Problems:

1) The Func _GUICtrlListView_AllUnChecked read also the first line ( select/unselect all ), how to remove from the _GUICtrlListView_GetItemCount ?

2) Read the ListView information from a txt, without know the number of the item

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#15 ·  Posted (edited)

New update:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>

Dim $SelectAll[1]

GUICreate("Example", 216, 201, -1, -1, -1, $WS_EX_ACCEPTFILES)
$iListView = GUICtrlCreateListView("Name1", 10, 10, 192, 150, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 185)
$hListView = GUICtrlGetHandle($iListView)
$SelectAll[0] = GUICtrlCreateListViewItem("Select/Unselect All", $iListView)
$Button = GUICtrlCreateButton("Save", 11, 162, 186, 20)
GUISetState(@SW_SHOW)

File_Create()
Load_Value()

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
FileOpen(@WorkingDir & "Test.txt", 2)
For $i = 2 To $SelectAll[0]
    If _GUICtrlListView_GetItemChecked($iListView, $i - 1) Then
     FileWrite(@WorkingDir & "Test.txt", _GUICtrlListView_GetItemText($iListView, $i - 1) & @CRLF)
    EndIf
Next
If _GUICtrlListView_AllUnChecked($hListView) = True Then
    MsgBox(0, 0, "No element(s) selected")
Else
    ShellExecute(@WorkingDir & "Test.txt")
EndIf
EndSwitch
WEnd

Func File_Create()
$Test = FileOpen(@WorkingDir & "Test.txt", 2)
FileWrite($Test, "Value11" & @LF & "Value22" & @LF & "Value33" & @LF & "Value44")
EndFunc

Func _GUICtrlListView_AllUnChecked($hListView)
Local $iChecked = 1, $iCount = _GUICtrlListView_GetItemCount($hListView)
For $i = 0 To $iCount - 1
If Not _GUICtrlListView_GetItemChecked($hListView, $i) Then
$iChecked += 1
EndIf
Next
Return $iChecked = $iCount ; Returns True - all items are unchecked or False - some are unchecked.
EndFunc ;==>_GUICtrlListView_AllUnChecked

Func Load_Value()
$File = FileRead(@WorkingDir & "Test.txt")
$array = StringSplit($File, @LF)
For $i = 1 To $array[0] - 1
GUICtrlCreateListViewItem(StringTrimRight($array[$i], 1), $iListView)
Next
EndFunc ;==>Load_Value

Now the script load the information from a txt ( remove last line and last letter of every line, but i need it )

I need to add only a working checkbox "Select/Unselect All"

Please :D

Edited by johnmcloud

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

I think i'm not understand :(

I have not figured out how to apply it to my situation. I have no variables, I have only one value ($SelectAll), the others are generated from the contents of the file

So i want to click on "Select/Unselect All" checkbox, if checked the other are checked and viceversa.

The script, with the new button for load the value and one for save:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>

Dim $SelectAll[1]
 
$_1 = GUICreate("Example", 217, 202, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_WINDOWEDGE))
$iListView = GUICtrlCreateListView("Name1", 10, 10, 192, 150, -1, BitOR($WS_EX_CLIENTEDGE,$LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 180)
$hListView = GUICtrlGetHandle($iListView)
$ButtonSave = GUICtrlCreateButton("Save", 107, 164, 92, 20)
$ButtonLoad = GUICtrlCreateButton("Load", 19, 166, 84, 20)
GUISetState(@SW_SHOW)

File_Create()

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
  Case $GUI_EVENT_CLOSE
   Exit
  Case $ButtonLoad
   $SelectAll[0] = GUICtrlCreateListViewItem("Select/Unselect All", $iListView)
   Load_Value()
  Case $ButtonSave
   FileOpen(@WorkingDir & "Test.txt", 2)
   For $i = 2 To $SelectAll[0]
    If _GUICtrlListView_GetItemChecked($iListView, $i - 1) Then
     FileWrite(@WorkingDir & "Test.txt", _GUICtrlListView_GetItemText($iListView, $i - 1) & @CRLF)
    EndIf
   Next
   If _GUICtrlListView_AllUnChecked($hListView) = True Then
    MsgBox(0, 0, "No element(s) selected")
   Else
    ShellExecute(@WorkingDir & "Test.txt")
   EndIf
EndSwitch
WEnd

Func File_Create()
$Test = FileOpen(@WorkingDir & "Test.txt", 2)
FileWrite($Test, "Value11" & @LF & "Value22" & @LF & "Value33" & @LF & "Value44")
EndFunc   ;==>File_Create

Func _GUICtrlListView_AllUnChecked($hListView)
Local $iChecked = 1, $iCount = _GUICtrlListView_GetItemCount($hListView)
For $i = 0 To $iCount - 1
  If Not _GUICtrlListView_GetItemChecked($hListView, $i) Then
   $iChecked += 1
  EndIf
Next
Return $iChecked = $iCount ; Returns True - all items are unchecked or False - some are unchecked.
EndFunc   ;==>_GUICtrlListView_AllUnChecked

Func Load_Value()
$File = FileRead(@WorkingDir & "Test.txt")
$array = StringSplit($File, @LF)
For $i = 1 To $array[0] - 1
  GUICtrlCreateListViewItem(StringTrimRight($array[$i], 1), $iListView)
Next
EndFunc   ;==>Load_Value
Edited by johnmcloud

Share this post


Link to post
Share on other sites

#18 ·  Posted (edited)

I think i have a solution:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ListviewConstants.au3>
#include <GuiListView.au3>

Dim $SelectAll[1]

$_1 = GUICreate("Example", 217, 202, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES, $WS_EX_WINDOWEDGE))
$iListView = GUICtrlCreateListView("Name1", 10, 10, 192, 150, -1, BitOR($WS_EX_CLIENTEDGE, $LVS_EX_CHECKBOXES))
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 180)
$hListView = GUICtrlGetHandle($iListView)
$ButtonSave = GUICtrlCreateButton("Save", 107, 164, 92, 20)
$ButtonLoad = GUICtrlCreateButton("Load", 19, 166, 84, 20)
GUISetState(@SW_SHOW)

File_Create()

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $ButtonLoad
$SelectAll[0] = GUICtrlCreateListViewItem("Select/Unselect All", $iListView)
Load_Value()
Case $ButtonSave
FileOpen(@WorkingDir & "Test.txt", 2)
For $i = 2 To $SelectAll[0]
    If _GUICtrlListView_GetItemChecked($iListView, $i - 1) Then
     FileWrite(@WorkingDir & "Test.txt", _GUICtrlListView_GetItemText($iListView, $i - 1) & @CRLF)
    EndIf
Next
If _GUICtrlListView_AllUnChecked($hListView) = True Then
    MsgBox(0, 0, "No element(s) selected")
Else
    ShellExecute(@WorkingDir & "Test.txt")
EndIf
Case $SelectAll[0]
If _GUICtrlListView_GetItemChecked($iListView, $SelectAll) Then
_GUICtrlListView_SetItemChecked($iListView, $SelectAll[0], 1)
_GUICtrlListView_SetCheckedStates($hListView, 1)
EndIf
If Not _GUICtrlListView_GetItemChecked($iListView, $SelectAll) Then
_GUICtrlListView_SetItemChecked($iListView, $SelectAll, 2)
_GUICtrlListView_SetCheckedStates($hListView, 2)
EndIf
EndSwitch
WEnd

Func File_Create()
$Test = FileOpen(@WorkingDir & "Test.txt", 2)
FileWrite($Test, "Value11" & @LF & "Value22" & @LF & "Value33" & @LF & "Value44")
EndFunc ;==>File_Create

Func _GUICtrlListView_AllUnChecked($hListView)
Local $iChecked = 1, $iCount = _GUICtrlListView_GetItemCount($hListView)
For $i = 0 To $iCount - 1
If Not _GUICtrlListView_GetItemChecked($hListView, $i) Then
$iChecked += 1
EndIf
Next
Return $iChecked = $iCount ; Returns True - all items are unchecked or False - some are unchecked.
EndFunc ;==>_GUICtrlListView_AllUnChecked

Func Load_Value()
$File = FileRead(@WorkingDir & "Test.txt")
$array = StringSplit($File, @LF)
For $i = 1 To $array[0] - 1
GUICtrlCreateListViewItem(StringTrimRight($array[$i], 1), $iListView)
Next
EndFunc ;==>Load_Value

Func _GUICtrlListView_SetCheckedStates($hListView, $iType) ; By Zedna, Modified by guinness.
Local $fState = False, $iCount = _GUICtrlListView_GetItemCount($hListView)
If $iType < 0 Or $iType > 2 Then
Return SetError(1, 0, 0)
EndIf
If $iType Then
$fState = True
EndIf
For $i = 0 To $iCount - 1
If $iType = 2 Then
$fState = Not _GUICtrlListView_GetItemChecked($hListView, $i) ; Invert checked state with $iType 2.
EndIf
_GUICtrlListView_SetItemChecked($hListView, $i, $fState)
Next
EndFunc ;==>_GUICtrlListView_SetCheckedStates

There is only a problem, if you click fast on checkbox "select/unselect all" sometimes lose the function. Someone what to test for search a workaround?

Thanks

Edited by johnmcloud

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • wakillon
      TinyBackupBox
      By wakillon
      Do a backup of a folders list
    • Mendes
      Checkbox and javascript
      By Mendes
      First of all i am sorry for this, it may be a  kind of a repost, i had a topic going with this subject but it started with something else and i was reading it in order to re-think the problem and found that it was somewhat confusing.
      So  i am creating a new topic previous one was
       

       
      Basicaly I have a problem with a check box,  
      This is what i do:
      I load a webpage with IEcreate assigning to $oIE Then i assign to $oforms the forms in that page Then i pick a field in  $oforms[1] (lets call it field[1] and insert a value into it. Then i submit the form Since i can't submit the form because it uses javascript in a link i use _IELinkClickByText($oIE, "LINKTOSUBMIT") I print out the information of those forms for debugging purposes
      Local $oIE = _IECreate("website.example.com") Local $oForms = _IEFormGetCollection($oIE) local $leilaocod local $i For $oForm In $oForms ConsoleWrite ("Form Info : " & $oForm.name & @CRLF) $oelements = _IEFormElementGetCollection($oform) For $oelement In $oelements if $oelement.name = "" then $oelement.name = "*********" ConsoleWrite (" Element Info | Name : " & $oelement.name & " Type : " & $oelement.Type & " Value : " & $oelement.Value & @CRLF) if $oelement.name = "leilaoCod" then $leilaocod = $oelement.value if $oelement.name = "valorLicitar" then _IEFormElementSetValue($oelement, 1337) _IELinkClickByText($oIE, "submit link") _IELoadWait ($oIE) ;condicoesclick() EndIf Next Next  
      Printout : 
       
      The page loads into a new page (because i just cliked the link) and i have a check box there.
       
      i try then checking the checkbox
       
      Local $oForm1 = _IEFormGetObjByName($oIE, "formulario") _IEFormElementCheckBoxSelect($oForm1,"1", "condicao", 1, "byValue")  
      Nothing happens, and i figured well maybe the new forms aren't in the $oforms collection so i cant get it i decided then to repopulate the $oforms with 
       
      Local $oForms = _IEFormGetCollection($oIE) For $oForm In $oForms ConsoleWrite ("Form Info : " & $oForm.name & @CRLF) $oelements = _IEFormElementGetCollection($oform) For $oelement In $oelements ConsoleWrite (" Element Info | Name : " & $oelement.name & " Type : " & $oelement.Type & " Value : " & $oelement.Value & @CRLF) ; EndIf Next Next  
      I get the same print out 
       
      I am gessing that my $oIE object still has the previous page elements  (so no new form and no checkbox there )
       
      How can i use 
      Local $oForm1 = _IEFormGetObjByName($oIE, "formulario")
      _IEFormElementCheckBoxSelect($oForm1,"1", "condicao", 1, "byValue")
       
      Or how can i load the page elements to the $oIE if the new page was generated after a _IELinkClickByText($oIE, "link")
      Anyway when i try checking the box i get a ...
       
      And i get a   IE.au3 T3.0-2 Warning from function _IEFormElementCheckBoxSelect, $_IESTATUS_NoMatch
       
       
    • 31290
      File into list view and other
      By 31290
      Hi Everyone, Happy New Year
      Well, I have a script that gather information about a given switch here at work that output data in a txt file:

      What I'd like to do first is to put the file in a list view with the possibility to sort the ports by VLAN, by ports or by Status (and also delete all that concern Duplex / Speed / Type).
      In a second time, I'd like to bold and color "connected" in green / "disconnected" in red and "err-disabled" in gray. Then, I'd like also to apply a certain color depending on the VLAN number (I have the list of them).
      And to finish (sorry ^^) when I double click on a list item, I'd like to retrieve information of the selected line for me to do some operation on it.
      I know this is quite an ask but this is something I don't know how to (don't worry, I've done some researches before) do and also, I'm not familiar with arrays at all.
      Many thanks for those who can help

      I've uploaded the output txt file: EPES18.txt
    • Guy_
      A shortlist of short List questions
      By Guy_
      Been using GUICtrlCreateList for the first time in the last few days and am wondering for how many currently perceived shortcomings I am still to blame...
      Been scanning some of the special settings here and there, but currently still wondering about these...
      Even "yes" or "no" can be helpful. More is welcome if it saves me some hours 
      1) When wanting to hilite a List item with the help of GUICtrlSetData ( $myList, data, $hiliteThisItem ), my impression is that this is not case sensitive? If not, can this be set to be so? [solved, if *not* using $LBS_EXTENDEDSEL only?]
      2) Is it possible to have right-clicking an item also immediately making it the active item (highlight it)...?
      3) Is manually dragging items for custom sorting possible?
      4) While using my scroll wheel inside a List, I've been hearing some beeps, as if it wanted to tell me when I got to the edge of either end. However, it does not seem to work consistently and I don't want these sounds anyway. Are they from AutoIt and can I disable them?
      5) Is it possible to multi-select items?  (à la Ctrl-click) [solved with $LBS_EXTENDEDSEL]
      6) [non-List question] Is it possible that using the Return key inside a GUICtrlCreateInput field activates a Function?
      Thanks for any tips!
    • franbrinus
      Get Info of Table
      By franbrinus
      Hello,
      I want get the items of a table. The table is in a window of an deskpot application. I hava upload a image of the table.
      I want read the values of all items and columns for I select the item that I am finding. I have used ListBox and ListView methods and I get the number of items but I can't get the text of columns and I can`t select one item.
      Can you help me? Thank you.