Jump to content

Possibility to *DELETE* element from GuiCtrlCreateCombo()'s content?


rudi
 Share

Recommended Posts

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

@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 by FireFox
Link to comment
Share on other sites

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 by Authenticity
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...