Skip to main content
GameDev.net gamedev.net
🔒 Locked

WinAPI Tabs

Started by fitfool Nov 22, 2008 at 5:02 PM 2 replies 1.5k views
Original Post
fitfool
fitfool
I have created a tab control and attached 2 tabs to it, in WinAPI(c++), as seen here: http://img510.imageshack.us/img510/8990/69941214xa9.jpg As you can see, i have a tab called 'TCP', and a 'UDP' tab, there is also a button in there. My problem is, i can't find out how you attach a button to one of these tabs, i mean, so it's visible under one tab, but not visible under the other. Any clues? thanks
Endurion
Endurion
This is something you have to do yourself. There's a notification TCN_SELCHANGE which gets fired via WM_NOTIFY if the user clicks on a tab.

On receiving this event you need to hide/show wanted controls. The common approach is to build a dialog resource (starting hidden, as child) for every tab page and add them into the tab control (calculate the rect via TCM_ADJUSTRECT). On TCN_SELCHANGE hide the current subdialog and show the new active dialog.
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
fitfool
fitfool
Thanks Endurion and george. I was afraid i was going to have to intercept the tab selection message and show wanted controls :/

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.