Sign in to follow this  
fitfool

WinAPI Tabs

Recommended Posts

fitfool    113
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

Share this post


Link to post
Share on other sites
Endurion    5411
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.

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