Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read value changed of TIWBS4Dropdown
#2
When you add items, you need to add an OnAsyncClick event to each item. I create 90+% of my IWBS4 components at run-time and here is how I add them in c++ (example):

TIWBS4DropDownItem * pDropDownItem = dynamic_cast<TIWBS4DropDownItem *> (CalendarNavigationMonthSelectDropDown->DropDownItems->Add());
pDropDownItem->Caption = FormatDateTime(L"mmmm yyyy",nDateStart);
pDropDownItem->Css = L" EventCalendarMonth";
pDropDownItem->OnAsyncClick = OnCalendarNavigationMonthSelectAsyncChange;

When the item is selected from the dropdown, the OnAsyncClick event is fired.

To get the index of the item selected in the event, do something like this:

void __fastcall TVTS3SelectEventCalendarForm::OnCalendarNavigationMonthSelectAsyncChange(TObject *Sender, TStringList *EventParams)
{
// Keep compiler happy
NOT_USED(Sender);

// Get selected month
int nSelectedMonth = EventParams->Values[L"itemidx"].ToIntDef(0);

...
}

Hope this helps!

Shane
Reply


Messages In This Thread
RE: How to read value changed of TIWBS4Dropdown - by ShaneStump - 06-01-2020, 08:15 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)