News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

How to? Putting a listbox inside a tab control

Started by NoCforMe, October 11, 2023, 04:21:33 AM

Previous topic - Next topic

NoCforMe

Quote from: TimoVJL on October 12, 2023, 01:33:05 AMPerhaps making an array for listboxes and creating listboxes to main window is one option.
Then handle notify messages in main window proc and check index of current tab for right listbox.

Yes, it's even simpler than that. In my case the "main window" is a dialog, and yes, I'm creating the listboxes as children of the dialog as well as the tab control. When I get a TCN_SELCHANGE notification, I simply find out which tab is active (by using TCM_GETCURSEL). Since there are only 2 listboxes I can just use the index value (0 or 1) to select the right listbox. No need for an array, pointers, etc.
Assembly language programming should be fun. That's why I do it.

TimoVJL

Many years ago if (pNMHdr->code == TCN_SELCHANGE)
{
iC = TabCtrl_GetCurSel(pNMHdr->hwndFrom);
ShowWindow(hTabWnd[iC], SW_SHOW);
ResizeControls(hWnd);
SetFocus(hTabWnd[iC]);
if (iC == 2)
FillForm();
}
return;
May the source be with you