ozmike Posted June 10, 2010 Share Posted June 10, 2010 Can we do multi column combo boxes - and hide columns I want to have data in a combo ABC "www.yyy.com" DEF "www.jjj.com" I want to show the below - i want to hide column 2 eg. ABC DEF I want to do this so that i don't have to maintain a separate 2d array - I know you can do this with list views but what about combos.. mike Link to comment Share on other sites More sharing options...
Yoriz Posted June 10, 2010 Share Posted June 10, 2010 (edited) You could do it like this. #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $aComboContents[2] = ["ABC www.yyy.com","DEF www.jjj.com"] #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 261, 122, -1, -1) $Combo1 = GUICtrlCreateCombo("", 58, 50, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) For $i = 0 To UBound($aComboContents)-1 Step 1 $aComboPart = StringSplit($aComboContents[$i], " ") GUICtrlSetData(-1, $aComboPart[1], $aComboPart[1]) Next GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Combo1 $sText = GUICtrlRead($Combo1) For $i = 0 To UBound($aComboContents)-1 Step 1 $aComboPart = StringSplit($aComboContents[$i], " ") If $aComboPart[1] = $sText Then MsgBox(0, "Selected", $aComboPart[2]) ExitLoop EndIf Next EndSwitch WEnd Edited June 10, 2010 by Yoriz GDIPlusDispose - A modified version of GDIPlus that auto disposes of its own objects before shutdown of the Dll using the same function Syntax as the original.EzMySql UDF - Use MySql Databases with autoit with syntax similar to SQLite UDF. Link to comment Share on other sites More sharing options...
ozmike Posted June 11, 2010 Author Share Posted June 11, 2010 Thanks that solution work.. I was hoping there was such a control ..like in msaccess ..but your solution works.. I'll have to check out KODA.. Link to comment Share on other sites More sharing options...
spudw2k Posted June 15, 2010 Share Posted June 15, 2010 You can also use the _GUICtrlComboBoxEx_SetItemParam/_GUICtrlComboBoxEx_GetItemParam functions, but they do not display the second value in the combox either. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now