Jump to content

need help with ComboLBox


Recommended Posts

anyone know how to work with comboLbox?I'm having problem with it.I'm having problem retrieving items listed inside a comboLbox and thus clicking on it.would appreciate if you all could help me...thanks!

Check the help file for the _GuiCtrlCombo* functions. Post short demo code if you need more specific help.

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Check the help file for the _GuiCtrlCombo* functions. Post short demo code if you need more specific help.

:whistle:

hi psaltyds, thanks for your reply....coz I'm new to autoitscirpt so i dont know much about autoitscript....below is a few lines of mine codes on the combobox part...hope you can help me with it....thanks!

ControlCommand ( "Change Directory", "", "ThunderRT6DriveListBox1", "ShowDropDown", "" )

Sleep(500)

WinActivate("Change Directory", "c: [W3612]")

Sleep(500)

ControlCommand ( "Change Directory", "c: [W3612]", "ComboLBox1", "FindString", "d:" )

ControlCommand( "Change Directory", "", "ComboLBox1", "GetCurrentSelection", "")

ControlClick("Change Directory", "", "ComboLBox1", "left", 1, 39, 48)

Link to comment
Share on other sites

hi psaltyds, thanks for your reply....coz I'm new to autoitscirpt so i dont know much about autoitscript....below is a few lines of mine codes on the combobox part...hope you can help me with it....thanks!

ControlCommand ( "Change Directory", "", "ThunderRT6DriveListBox1", "ShowDropDown", "" )

Sleep(500)

WinActivate("Change Directory", "c: [W3612]")

Sleep(500)

ControlCommand ( "Change Directory", "c: [W3612]", "ComboLBox1", "FindString", "d:" )

ControlCommand( "Change Directory", "", "ComboLBox1", "GetCurrentSelection", "")

ControlClick("Change Directory", "", "ComboLBox1", "left", 1, 39, 48)

Hmm... :whistle:

ComboLBox is a "special" case, if I recall.

The help file for ControlCommand() specifically says:

Certain commands that work on normal Combo and ListBoxes do not work on "ComboLBox" controls.

Do you or anyone else know of a common app, or a freeware or open source one, that would use this control type for experimenting on?

:lmao:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

  • 6 months later...

Hmm... :)

ComboLBox is a "special" case, if I recall.

The help file for ControlCommand() specifically says:

Do you or anyone else know of a common app, or a freeware or open source one, that would use this control type for experimenting on?

:)

Hey,

I am having troubles to click (or identify or select) a string in a given ComboLbox. The ComboLbox does not seem to have Window title, only handle. I am not sure if I will be able to get the handle.

Anyway, you can see one application of this style of Control in Adobe Acrobat PDF printing properties/Layout/advanced. It is a SysTreeView32 window.

Let me know please if anyone managed to solve the issue. PM please.

Link to comment
Share on other sites

Hey,

I am having troubles to click (or identify or select) a string in a given ComboLbox. The ComboLbox does not seem to have Window title, only handle. I am not sure if I will be able to get the handle.

Anyway, you can see one application of this style of Control in Adobe Acrobat PDF printing properties/Layout/advanced. It is a SysTreeView32 window.

Let me know please if anyone managed to solve the issue. PM please.

Hi, has anyone managed to select text using a comboLbox ? I also need it :)

Link to comment
Share on other sites

  • 8 months later...

Hi, has anyone managed to select text using a comboLbox ? I also need it :mellow:

I had the same problem here is function that I wrote to select a string from the comboxes' that use comboLbox. What it does is opens the dropdown listbox control in the combobox and sets the cursor in the listbox. This causes editbox portion of the combobox to update allowing you to read the string and compare it.

#Include <GuiComboBox.au3>
#Include <GuiEdit.au3>
#Include <GuiListBox.au3>

Func ComboLBox_SelectString($Window,$WindowText,$ControlID, $SelectString, $fPartialOK = True)
    Local $tInfo
    $returnVal=False
    $hCombo=ControlGetHandle($Window, $WindowText,$ControlID)
    If _GUICtrlComboBox_GetComboBoxInfo($hCombo, $tInfo) Then
        $hEdit=DllStructGetData($tInfo, "hEdit")
        $hList=DllStructGetData($tInfo, "hList")
        
        $EditTxt=_GUICtrlEdit_GetText($hEdit)
        If (((StringInStr($EditTxt, $SelectString)>0) AND $fPartialOK) Or((StringCompare($EditTxt, $SelectString)=0) AND NOT $fPartialOK))  Then
                $returnVal=True
        Else
            ;Open ListBox Control
            _GUICtrlComboBox_ShowDropDown($hCombo, True)
            ;Find SetText and Select 
            $i=0
            $ListEnd=_GUICtrlListBox_GetCount($hList) - 1
            While($i<=$ListEnd AND NOT $returnVal)
                _GUICtrlListBox_SetCurSel($hList,$i)
                $EditTxt=_GUICtrlEdit_GetText($hEdit)
                If (((StringInStr($EditTxt, $SelectString)>0) AND $fPartialOK) Or((StringCompare($EditTxt, $SelectString)=0) AND NOT $fPartialOK))  Then
                        $returnVal=True
                        _GUICtrlListBox_ClickItem($hList,$i)
                EndIf
                $i=$i+1
            WEnd
            _GUICtrlComboBox_ShowDropDown($hCombo, False)
        EndIf
    EndIf
    Return $returnVal
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...