PDA

View Full Version : how to: make each combobox item has his own script


history teacher
04-23-2007, 08:08 AM
hi everyone
i tried to make diffrent action for each item in the combobox
but i found that the action works for all items
need help plz

Tek
04-23-2007, 08:51 AM
You could store some data in the combobox that's specific to the entry and call a function with that information.

Jonas DK
04-23-2007, 09:37 AM
You could store some data in the combobox that's specific to the entry and call a function with that information.

yes,

Use the data field to store a function call for eatch item in the combobox

that is actually a were need idea.

I think that you can actually use the data filed to hold small scripts, think there is an exampel somewhere on this forum that shows how to use a combobox as a menu, just can't find it, but I'm sure I've seen it somewhere...

cheers,
Jonas

bule
04-23-2007, 09:50 AM
You could store each's item function in the data field as suggested.
In this case, add this to the On Select script of the combobox:

loadstring(ComboBox.GetItemData(this, ComboBox.GetSelected(this))