rudi Posted February 20, 2009 Share Posted February 20, 2009 Hi.For GUICtrlCreateCombo() I can add elements using GUICtrlSetData().How to remove elements from the current element's list?As the GUICtrlCreateDate() isn't comfortable, when the date to be selected is far away from "today", I want to use three combos to select year, month, day-of-month.Depending of the selection in "year" and "month" I will need to adjust the "day-of-month" combo's list, to offer 1-28, 1-29, 1-30, 1-31, to ensure that only valid dates can be entered.I'm just wondering if I will have to GuiCtrlDelete() and to recreate the "Day-Of-Month" combo?Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! Link to comment Share on other sites More sharing options...
FireFox Posted February 20, 2009 Share Posted February 20, 2009 (edited) @rudi GuiCtrlSetData($cbo, '') ;clear combo list GuiCtrlSetData($cbo, 'new list') ;set new data Edit : $s_search = '2' $s_replace = '4' ;your $cbo here GuiCtrlSetData($cbo, '1|2|3|4') ;example $readcbo = _GuiCtrlComboBox_GetList($cbo) GuiCtrlSetData($cbo, '') $setcbo = StringReplace($readcbo, $s_search, $s_replace) GuiCtrlSetData($cbo, $setcbo) Not tested. Cheers, FireFox. Edited February 20, 2009 by FireFox Link to comment Share on other sites More sharing options...
Authenticity Posted February 20, 2009 Share Posted February 20, 2009 (edited) I'd recommend to create it using _GUICtrlComboBoxEx_Create() and handle it via only _GuiCtrlComboBoxEx_* functions. Another thing you can do is associate an item with each element and search for that item to delete it. If it's a unique string then _GuiCtrlComboBox_* is easier and more proper for this task. Edited February 20, 2009 by Authenticity Link to comment Share on other sites More sharing options...
rudi Posted February 21, 2009 Author Share Posted February 21, 2009 Hi. Thanks to both of you. Regards, Rudi. Earth is flat, pigs can fly, and Nuclear Power is SAFE! 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