Jess

Creating event for combo box

3 posts in this topic

I am trying to create an event for the combo box I have created in my GUI such that if value 1 is selected it will hide a particular column in the list view and if value 2 is selected, it will be as it is. I have tried doing that with a func but no output. And I a also trying to compare a column to another column but same I am not getting any result. I don't know much of autoit but just trying on some things.  Please try helping.

#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>

Example()

Func Example()
    GUICreate(" My GUI input acceptfile",700,600,-1,-1,$WS_MAXIMIZEBOX)
    GUISetBkColor (0xE0FFFF)

   Local Const $sFont = "Buenard"

   ; Create a combobox control.
   $mlabel1 = GUICtrlCreateLabel("Claim Edit Type", 50, 20,200,50)
    Local $idComboBox = GUICtrlCreateCombo("Select Your Option", 190, 20, 120, 300)

    ; Add additional items to the combobox.
    $button = GUICtrlSetData($idComboBox, "Value 1| Value 2", "Select Your Option")

     GUICtrlCreateButton("Search", 350, 20, 100, 30)
    GUICtrlSetOnEvent(-1 , "hide")

    GUICtrlCreateGraphic(5,70,1290,1,$SS_BLACKRECT)

    $mlabel2 = GUICtrlCreateLabel("DCN Number", 50, 80,150,70)
    GUICtrlSetFont ( $mlabel2, 12, 700)
    GUICtrlSetColor ( $mlabel2, 0x000080 )
    GUICtrlCreateInput("", 190, 80, 120, 23)

    GUICtrlCreateGraphic(5,120,1290,1,$SS_BLACKRECT)

     $label1 = GUICtrlCreateLabel("Claim ID", 50, 150,50,60)
     GUICtrlSetFont ( $label1, 9 , 500, 0 , $sFont )
    Local $idFile = GUICtrlCreateInput("", 120, 140, 100, 30)

      $label2 = GUICtrlCreateLabel("Subsc Id", 50, 195,80,60)
      GUICtrlSetFont ( $label2, 9 , 500, 0 , $sFont )
      GUICtrlCreateInput("", 120, 190, 100, 30)
      $label3 = GUICtrlCreateLabel("Claim type", 50, 240,80,60)
       GUICtrlSetFont ( $label3, 9 , 500, 0 , $sFont )
      $lInput = GUICtrlCreateInput("", 120, 245, 100, 30)
      $label4 = GUICtrlCreateLabel("Patient Name", 320, 150,80,60)
       GUICtrlSetFont ( $label4, 9 , 500, 0 , $sFont )
      GUICtrlCreateInput("", 470, 140, 100, 30)
      $label5 = GUICtrlCreateLabel("Billing Provider NPI", 320, 195,120,60)
       GUICtrlSetFont ( $label5, 9 , 500, 0 , $sFont )
      GUICtrlCreateInput("", 470, 190, 100, 30)
      $label6 = GUICtrlCreateLabel("Billing Provider Number", 320, 245,150,60)
       GUICtrlSetFont ( $label6, 9 , 500, 0 , $sFont )
      GUICtrlCreateInput("", 470, 240, 100, 30)






      GUICtrlSetFont ( $mlabel1, 12, 700)
      GUICtrlSetColor ( $mlabel1, 0x000080 )
    ;  GUICtrlSetFont ( $mlabel2, 12, 700)
    ;  GUICtrlSetColor ( $mlabel2, 0x000080 )

    EndFunc


    Local $hImage, $idListview

    $idListview = GUICtrlCreateListView("", 2,350, 700, 200,-1,$LVS_EX_GRIDLINES)
    GUICtrlSetBkColor($idListview, 0xE0E0E0)
    ;GUICtrlSetColor ( $idListview, 0x000080 )
     Local $idListview1 = GUICtrlCreateListView("", 2,325, 1300, 25)
   _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_GRIDLINES ,$LVS_EX_FLATSB,$LVS_REPORT))

    GUISetState(@SW_SHOW)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview1, "INCOMING CLAIM", 900,2)
    _GUICtrlListView_AddColumn($idListview1, "HISTORY CLAIM", 700,2)

    $col1 = _GUICtrlListView_AddColumn($idListview, "DCN No", 100)
    GUICtrlSetBkColor($col1, 0x330033)

    $col2 = _GUICtrlListView_AddColumn($idListview, "Serv Line No", 100)
    $col3 = _GUICtrlListView_AddColumn($idListview, "Service From Date", 100)
    $col4 = _GUICtrlListView_AddColumn($idListview, "Service To Date", 100)
    $col5 = _GUICtrlListView_AddColumn($idListview, "Revenue Code", 100)
    $col6 = _GUICtrlListView_AddColumn($idListview, "Diagnosis Code", 100)
    $col7 = _GUICtrlListView_AddColumn($idListview, "CPT Procedure Code", 100)
    $col8 = _GUICtrlListView_AddColumn($idListview, "Modifier", 100)
    $col9 = _GUICtrlListView_AddColumn($idListview, "Comp. Result", 100)
    $col10 = _GUICtrlListView_AddColumn($idListview, "DCN No", 100)
    $col11 = _GUICtrlListView_AddColumn($idListview, "Serv Line No", 100)
    $col12 = _GUICtrlListView_AddColumn($idListview, "Service From Date", 100)
    $col13 = _GUICtrlListView_AddColumn($idListview, "Service To Date", 100)
    $col14 = _GUICtrlListView_AddColumn($idListview, "CPT Procedure Code", 100)
    $col15 = _GUICtrlListView_AddColumn($idListview, "Modifier", 100)
#Region insertion into Service Line under Current Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell1 = _GUICtrlListView_AddSubItem($idListview, 0, "1", 1, 0)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell2 = _GUICtrlListView_AddSubItem($idListview, 1, "2", 1, 0)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell3 = _GUICtrlListView_AddSubItem($idListview, 2, "3", 1, 0)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into Service From Date under Current Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "3/9/1994", 2, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "3/7/1999", 2, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "3/8/1999", 2, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into Service To Date under Current Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "15/1/1994", 3, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "25/7/1999", 3, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "25/9/1999", 3, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into CPT Proc Code under Current Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "50", 6, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "26", 6, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "23", 6, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into Modifier under Current Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Bilateraal Procedure", 7, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Professional Component",7 , 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "Professionalll Component",7 , 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion


#Region insertion into Service Line under History Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell4 = _GUICtrlListView_AddSubItem($idListview, 0, "3", 10, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell5 = _GUICtrlListView_AddSubItem($idListview, 1, "1", 10, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    $cell6 = _GUICtrlListView_AddSubItem($idListview, 2, "2",10, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion


#Region insertion into Service From Date under History Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "3/12/1994", 11, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "6/4/2011", 11, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "3/7/1999", 11, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into Service To Date under History Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "15/12/1994", 12, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "16/4/2011", 12, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "25/7/1999", 12, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into CPT Proc Code under History Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "50", 13, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "22", 13, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "26", 13, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion

#Region insertion into Modifier under History Claim
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 0, "Bilateral Procedure", 14, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 1, "Increased Procedural Services",14 , 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
    _GUICtrlListView_AddSubItem($idListview, 2, "Professional Component",14, 1)
    _GUICtrlListView_InsertItem($idListview, "", -1)
#EndRegion


      $itemCount = _GUICtrlListView_GetItemCount ( $idListview) ;this should return 3
      MsgBox(0,"itemCount",$itemCount)
      $columnCount = _GUICtrlListView_GetColumnCount ( $idListview )
      MsgBox(0,"itemCount",$columncount)



      For $i = 0 to 2 Step 1
        Local $aItem = _GUICtrlListView_GetItem ( $idListview,$i,1)
        Local $aItem1 = _GUICtrlListView_GetItem ( $idListview,$i,10)

      Next

      if $aItem = $aItem1 Then
               MsgBox(0,"text","Loop is working")
         Else
               MsgBox(0,"text","Loop is not working")
         EndIf


    #cs
    Local $idBtn = GUICtrlCreateButton("Ok", 50, 1000, 60, 20)
    #ce
    GUISetState(@SW_SHOW)


 While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
                #cs
            Case $idBtn
                ExitLoop
                #ce
        EndSwitch
     WEnd

     Func hide($button)
        $readCombo = GUICtrlRead($button)
        MsgBox(0,"text",$readCombo)
        if $readCombo = "Value 1" Then
           _GUICtrlListView_HideColumn($idListview, 5)
        EndIf

 

Share this post


Link to post
Share on other sites



Jess,

You are mixing OnEvent and MessageLoop modes in that script - you need to use one or the other. Try this:

#include <GuiButton.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiListView.au3>
#include <StaticConstants.au3>

Example()

Func Example()
    GUICreate(" My GUI input acceptfile", 700, 600, -1, -1, $WS_MAXIMIZEBOX)
    GUISetBkColor(0xE0FFFF)

    Local Const $sFont = "Buenard"

    ; Create a combobox control.
    $mlabel1 = GUICtrlCreateLabel("Claim Edit Type", 50, 20, 200, 50)
    Local $idComboBox = GUICtrlCreateCombo("Select Your Option", 190, 20, 120, 300)

    ; Add additional items to the combobox.
    $button = GUICtrlSetData($idComboBox, "Value 1| Value 2", "Select Your Option")

    $idSearch = GUICtrlCreateButton("Search", 350, 20, 100, 30)

    GUICtrlCreateGraphic(5, 70, 1290, 1, $SS_BLACKRECT)

    $mlabel2 = GUICtrlCreateLabel("DCN Number", 50, 80, 150, 70)
    GUICtrlSetFont($mlabel2, 12, 700)
    GUICtrlSetColor($mlabel2, 0x000080)
    GUICtrlCreateInput("", 190, 80, 120, 23)

    GUICtrlCreateGraphic(5, 120, 1290, 1, $SS_BLACKRECT)

    $label1 = GUICtrlCreateLabel("Claim ID", 50, 150, 50, 60)
    GUICtrlSetFont($label1, 9, 500, 0, $sFont)
    Local $idFile = GUICtrlCreateInput("", 120, 140, 100, 30)

    $label2 = GUICtrlCreateLabel("Subsc Id", 50, 195, 80, 60)
    GUICtrlSetFont($label2, 9, 500, 0, $sFont)
    GUICtrlCreateInput("", 120, 190, 100, 30)
    $label3 = GUICtrlCreateLabel("Claim type", 50, 240, 80, 60)
    GUICtrlSetFont($label3, 9, 500, 0, $sFont)
    $lInput = GUICtrlCreateInput("", 120, 245, 100, 30)
    $label4 = GUICtrlCreateLabel("Patient Name", 320, 150, 80, 60)
    GUICtrlSetFont($label4, 9, 500, 0, $sFont)
    GUICtrlCreateInput("", 470, 140, 100, 30)
    $label5 = GUICtrlCreateLabel("Billing Provider NPI", 320, 195, 120, 60)
    GUICtrlSetFont($label5, 9, 500, 0, $sFont)
    GUICtrlCreateInput("", 470, 190, 100, 30)
    $label6 = GUICtrlCreateLabel("Billing Provider Number", 320, 245, 150, 60)
    GUICtrlSetFont($label6, 9, 500, 0, $sFont)
    GUICtrlCreateInput("", 470, 240, 100, 30)

    GUICtrlSetFont($mlabel1, 12, 700)
    GUICtrlSetColor($mlabel1, 0x000080)
    ;  GUICtrlSetFont ( $mlabel2, 12, 700)
    ;  GUICtrlSetColor ( $mlabel2, 0x000080 )

    $idListview = GUICtrlCreateListView("", 2, 350, 700, 200, -1, $LVS_EX_GRIDLINES)
    GUICtrlSetBkColor($idListview, 0xE0E0E0)
    ;GUICtrlSetColor ( $idListview, 0x000080 )
    Local $idListview1 = GUICtrlCreateListView("", 2, 325, 1300, 25)
    _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FLATSB, $LVS_REPORT))

    GUISetState(@SW_SHOW)

    ; Add columns
    _GUICtrlListView_AddColumn($idListview1, "INCOMING CLAIM", 900, 2)
    _GUICtrlListView_AddColumn($idListview1, "HISTORY CLAIM", 700, 2)

    $col1 = _GUICtrlListView_AddColumn($idListview, "DCN No", 100)
    GUICtrlSetBkColor($col1, 0x330033)

    $col2 = _GUICtrlListView_AddColumn($idListview, "Serv Line No", 100)
    $col3 = _GUICtrlListView_AddColumn($idListview, "Service From Date", 100)
    $col4 = _GUICtrlListView_AddColumn($idListview, "Service To Date", 100)
    $col5 = _GUICtrlListView_AddColumn($idListview, "Revenue Code", 100)
    $col6 = _GUICtrlListView_AddColumn($idListview, "Diagnosis Code", 100)
    $col7 = _GUICtrlListView_AddColumn($idListview, "CPT Procedure Code", 100)
    $col8 = _GUICtrlListView_AddColumn($idListview, "Modifier", 100)
    $col9 = _GUICtrlListView_AddColumn($idListview, "Comp. Result", 100)
    $col10 = _GUICtrlListView_AddColumn($idListview, "DCN No", 100)
    $col11 = _GUICtrlListView_AddColumn($idListview, "Serv Line No", 100)
    $col12 = _GUICtrlListView_AddColumn($idListview, "Service From Date", 100)
    $col13 = _GUICtrlListView_AddColumn($idListview, "Service To Date", 100)
    $col14 = _GUICtrlListView_AddColumn($idListview, "CPT Procedure Code", 100)
    $col15 = _GUICtrlListView_AddColumn($idListview, "Modifier", 100)
    #Region insertion into Service Line under Current Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell1 = _GUICtrlListView_AddSubItem($idListview, 0, "1", 1, 0)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell2 = _GUICtrlListView_AddSubItem($idListview, 1, "2", 1, 0)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell3 = _GUICtrlListView_AddSubItem($idListview, 2, "3", 1, 0)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service Line under Current Claim

    #Region insertion into Service From Date under Current Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "3/9/1994", 2, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "3/7/1999", 2, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "3/8/1999", 2, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service From Date under Current Claim

    #Region insertion into Service To Date under Current Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "15/1/1994", 3, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "25/7/1999", 3, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "25/9/1999", 3, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service To Date under Current Claim

    #Region insertion into CPT Proc Code under Current Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "50", 6, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "26", 6, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "23", 6, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into CPT Proc Code under Current Claim

    #Region insertion into Modifier under Current Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "Bilateraal Procedure", 7, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "Professional Component", 7, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "Professionalll Component", 7, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Modifier under Current Claim


    #Region insertion into Service Line under History Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell4 = _GUICtrlListView_AddSubItem($idListview, 0, "3", 10, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell5 = _GUICtrlListView_AddSubItem($idListview, 1, "1", 10, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        $cell6 = _GUICtrlListView_AddSubItem($idListview, 2, "2", 10, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service Line under History Claim


    #Region insertion into Service From Date under History Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "3/12/1994", 11, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "6/4/2011", 11, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "3/7/1999", 11, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service From Date under History Claim

    #Region insertion into Service To Date under History Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "15/12/1994", 12, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "16/4/2011", 12, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "25/7/1999", 12, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Service To Date under History Claim

    #Region insertion into CPT Proc Code under History Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "50", 13, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "22", 13, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "26", 13, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into CPT Proc Code under History Claim

    #Region insertion into Modifier under History Claim
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 0, "Bilateral Procedure", 14, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 1, "Increased Procedural Services", 14, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
        _GUICtrlListView_AddSubItem($idListview, 2, "Professional Component", 14, 1)
        _GUICtrlListView_InsertItem($idListview, "", -1)
    #EndRegion insertion into Modifier under History Claim


    $itemCount = _GUICtrlListView_GetItemCount($idListview) ;this should return 3
    MsgBox(0, "itemCount", $itemCount)
    $columnCount = _GUICtrlListView_GetColumnCount($idListview)
    MsgBox(0, "itemCount", $columnCount)



    For $i = 0 To 2
        Local $aItem = _GUICtrlListView_GetItem($idListview, $i, 1)
        Local $aItem1 = _GUICtrlListView_GetItem($idListview, $i, 10)

        If $aItem = $aItem1 Then
            MsgBox(0, "Row " & $i, "Comparison valid")
        Else
            MsgBox(0, "Row " & $i, "Comparison invalid")
        EndIf
    Next


    #cs
        Local $idBtn = GUICtrlCreateButton("Ok", 50, 1000, 60, 20)
    #ce
    GUISetState(@SW_SHOW)


    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
            Case $idSearch
                hide($idComboBox, $idListview)
        EndSwitch
    WEnd

EndFunc   ;==>Example

Func hide($idComboBox, $idListview)

    $readCombo = GUICtrlRead($idComboBox)
    MsgBox(0, "text", $readCombo)
    If $readCombo = "Value 1" Then
        _GUICtrlListView_HideColumn($idListview, 5)
    EndIf

EndFunc   ;==>hide

And your column comparison code works fine - as you can see from the additional MsgBoxes that appear.

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

@Melba23 Thank You so much for this. It has done wonders to my script.

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