Sign in to follow this  
Followers 0
rudi

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

4 posts in this topic

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!

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by FireFox

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by Authenticity

Share this post


Link to post
Share on other sites

Hi.

Thanks to both of you.

Regards, Rudi.


Earth is flat, pigs can fly, and Nuclear Power is SAFE!

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  
Followers 0