StungStang Posted March 13, 2011 Share Posted March 13, 2011 (edited) Hi to all, i've a new question to do...I'm playing with KODA but i dont have find this option/style for combobox...i want to do an combobox like that :I want to display the "scroll bar" line in the combo...how you can see on this picture.Now i'have another question...is possible to have a color item in the combo box?...and is possible to set height of the combo?Now another question on an array, for example i've this array :Global $Country[10] = ['Africa',' Algeria',' Angola',' Burkina Faso',' Burundi',' Cameroon',' Cape Verde',' Congo']Is possible to break the array line like that:Global $Country[10] &= ['Africa','Algeria','Angola','Burkina Faso','Burundi'] ;I want break the line Global $Country[10] &= ['Cameroon','Cape Verde','Congo'] ;I want to continue the array contenent in another lineBut it dont work...how i can do that?Hi! Edited March 13, 2011 by StungStang Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 13, 2011 Moderators Share Posted March 13, 2011 StungStang,Just add the $WS_VSCROLL style to the combo to get a scrolbar. But you will need to limit the size of the combo - if you do not then the number of elements can reach quite large values before the scrollbar appears. You do this by sending the scroll bar a $CB_SETMINVISIBLE message - although it actually sets the maximum number of visible elements! And you use the _ character to extend lines.Here are all 3 of these in a simple script:#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> Global $aCountry[8] = ['Africa','Algeria','Angola','Burkina Faso','Burundi', _ 'Cameroon','Cape Verde','Congo'] ; Use _ to extend lines $sData = "" For $i = 0 To 7 $sData &= $aCountry[$i] & "|" Next $hGUI = GUICreate("Test", 500, 500) $hCombo = GUICtrlCreateCombo("", 10, 10, 100, 20, BitOR($CBS_DROPDOWNLIST,$WS_VSCROLL)) ; Add scroll bar GUICtrlSendMsg($hCombo, $CB_SETMINVISIBLE, 5, 0) ; Limit max number of items to show GUICtrlSetData($hCombo, $sData) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndAll clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
StungStang Posted March 13, 2011 Author Share Posted March 13, 2011 (edited) Thanks man...you are my rescue P.S. it's possible to have a colour name in combobox? Hi! Edited March 13, 2011 by StungStang Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 13, 2011 Moderators Share Posted March 13, 2011 StungStang, Colour is not as easy as that - take a look here for some ideas. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
StungStang Posted March 13, 2011 Author Share Posted March 13, 2011 Wow all this work for only a color string . No problem, i wont use it Hi, have nice day Link to comment Share on other sites More sharing options...
ProgAndy Posted March 13, 2011 Share Posted March 13, 2011 (edited) If you need to display colors, I propose to use ComboBoxEx and then use Icons to display the color and not modify the textcolor. Edit: See the example for _GUICtrlComboBoxEx_SetItemImage. Edited March 13, 2011 by ProgAndy *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
StungStang Posted March 13, 2011 Author Share Posted March 13, 2011 Another question... It's possible to disable an item in the combobox?...an not clickable item... I don't know if you have understand me Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted March 13, 2011 Moderators Share Posted March 13, 2011 StungStang, I do not believe that is possible. You will need to either reload your combo without the item you do not want to select (my preferred solution) or deal with the item once it has been selected. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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