Jump to content
  • Advertisement
Sign in to follow this  
fitfool

WinAPI Tabs

This topic is 3617 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
Thanks Endurion and george. I was afraid i was going to have to intercept the tab selection message and show wanted controls :/

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!