Jump to content
Sign in to follow this  
jfcby

Combobox with multi columns

Recommended Posts

jfcby

Hi,

I've been searching this forum and the help file looking for a way to create a combobox with multi columns loaded from a text file.

My txt file data will look like this:

Id1 Full Name 1

Id2 Full Name 2

Id3 Full Name 3

The ids and full names will not be the same character length. When the combobox selection is made I will only need the Id to be inserted into an IE form and the full name is for reference only.

The examples I found in the help file and in this forum are single column only.

Thank you for your help,

jfcby


Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB ****

Share this post


Link to post
Share on other sites
exodius

I guess I don't understand what you mean by "columns" in a combobox... Since comboboxes don't have columns?

This is about the closest thing I could fathom to what you want:

#include <GUIConstantsEx.au3>
Opt ("GuiOnEventMode", 1)

Global $combo

GUICreate("My GUI combo")
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE")

$combo = GUICtrlCreateCombo("Id1", 10, 10)
GUICtrlSetOnEvent (-1, "_ComboFunc")
GUICtrlSetData(-1, "Id2|Id3")

GUISetState()

While 1
    
    Sleep (50)
WEnd

Func _ComboFunc()
    Switch GUICtrlRead ($combo)
        Case "Id1"
            MsgBox (0, "Id1", "Full Name 1")
        Case "Id2"
            MsgBox (0, "Id2", "Full Name 2")
        Case "Id3"
            MsgBox (0, "Id3", "Full Name 3")
    EndSwitch
EndFunc

Func _GUI_EVENT_CLOSE()
    Exit
EndFunc
Edited by exodius

Share this post


Link to post
Share on other sites
TalivanIBM

I think they say this, a listview vice a combobox, i was searching this too, but not 2 controls, a style for combobox that can able columns in the list of the combobox, like groups in listview (it's an user function)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.