|
-
July 19th, 2004, 08:01 AM
#16
 Originally Posted by MrDoomMaster
Here is how I understand it:
Create a dialog >> Create the property sheet and center/size it inside of the dialog >> add dialog resources to each of the tab pages?
No. You just need to create the pages in the dialog resource editor. You don't have to create the dialog that the pages will be housed in. The PropertySheet() function will automatically create a dialog, whose size will depend on the size of your largest page.
Once PropertySheet() has been called, your application-defined callback function will handle its messages. Handle the WM_INITDIALOG message in this procedure and re-size it as necessary.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-
July 28th, 2004, 03:45 AM
#17
Mr. Bond,
I tried to follow through your tutorial. When I compile the code, I got one ERROR:
error C2065: 'PropSheet_HwndToIndex' : undeclared identifier
Is 'PropSheet_HwndToIndex' declared somewhere else or what? Please help, I want to learn creating tab control this way.
-
July 28th, 2004, 07:44 AM
#18
 Originally Posted by jbp2004
Mr. Bond,
I tried to follow through your tutorial. When I compile the code, I got one ERROR:
error C2065: 'PropSheet_HwndToIndex' : undeclared identifier
Is 'PropSheet_HwndToIndex' declared somewhere else or what? Please help, I want to learn creating tab control this way.
Yeah, in prsht.h. Be sure to include it:
Code:
Minimum DLL Version comctl32.dll version 5.80 or later
Header prsht.h
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-
August 2nd, 2004, 09:03 AM
#19
I want to use an actual tab control, not property sheets, as the tab control is housed in my main dialog. I think this is what the original poster wanted too. Does anyone know how to use *tab controls*? The MSDN docs for them are messy.
I've created my tab control, added the tabs, and have the dialogs I need to stick in it, but I can't find out how to actually display the dialogs inside the tab control. Any help would be greatly appreciated.
-
August 3rd, 2004, 02:42 AM
#20
Don_PhrostByte,
I read your problem just this morning. We have the same problem but my problem was solve a few days ago. Now, let me try to help you.
You said, I've created my tab control, added the tabs, and have the dialogs I need to stick in it, but I can't find out how to actually display the dialogs inside the tab control. Any help would be greatly appreciated.
Well, the tutorial I wrote in about a day! starts from scratch (from making dialogs/windows using MSVC++ resource editor) It's up to you if you will go through the tutorial in its entirety or find the portion that will solve your problem.
I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
-
August 3rd, 2004, 07:22 AM
#21
 Originally Posted by jbp2004
I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here
Great work, jbp. I've found a few things in your code that should be updated, though.
For one, there's no need to handle the WM_DESTROY message when using a modal dialog box. EndDialog() in your WM_CLOSE handler takes care of the dialog cleanup. PostQuitMessage() is not needed since you're not creating a message loop (Windows creates it for you).
You should return FALSE (as opposed to false) from your DlgProc.
I'm not sure if you need to use so many global variables. For instance, nTab is declared as global, but is only used in DlgProc. Better to make it a static variable in DlgProc instead. hdc, nmptr, and tci are others. By the way, what is the use for hdc?
Finally, you're destroying the windows you create before you create them. But you're not destroying them when your dialog box closes.
All in all, great job!
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
-
August 3rd, 2004, 07:59 PM
#22
Thank you for the corrections Mr. Bond, I can improve more!
I have updated the article based on Mr. Bond's corrections.
If you are looking for a tutorial on how to use tab control
read my article here
Thanks!
Last edited by jbp2004; August 3rd, 2004 at 09:25 PM.
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
-
August 22nd, 2004, 07:39 PM
#23
 Originally Posted by jbp2004
Thank you for the corrections Mr. Bond, I can improve more!
I have updated the article based on Mr. Bond's corrections.
If you are looking for a tutorial on how to use tab control
read my article here
Thanks!
looks good, still has some quirks:
TabProc should use a switch.
Only one HWND is used at one time for the tab pages, but there are 3 variables. Make it use one.
thanks though, it was a good refresher.
-
January 14th, 2005, 04:11 PM
#24
Re: Need tutorial on Tab Controls in Windows API
 Originally Posted by jbp2004
Don_PhrostByte,
I have submitted a copy of this tutorial here in CODEGURU but since it is still pending, let me give you the copy that I have uploaded to my website, it's here
The link is dead and I have not succeeded in locating this tutorial in codeguru. Please point me to where this tutorial ended up? Thanks.
-
January 15th, 2005, 04:22 AM
#25
Re: Need tutorial on Tab Controls in Windows API
 Originally Posted by jkoutavas
The link is dead and I have not succeeded in locating this tutorial in codeguru. Please point me to where this tutorial ended up? Thanks.
EasyWin32 Library
-
February 2nd, 2005, 09:16 PM
#26
Re: Need tutorial on Tab Controls in Windows API
Wow I made a post that earned 3,500+ views
-
February 4th, 2005, 08:53 AM
#27
Re: Need tutorial on Tab Controls in Windows API
You can see working sample of property sheet embedded in a window in this thread.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
February 11th, 2008, 04:24 AM
#28
Re: Need tutorial on Tab Controls in Windows API
Could someone please post a zip file with the source code for this?
I can get it to compile but when I run it the program exits immediately after briefly flickering a dialog window.
Not sure if some of the code was left as an exercise to the student or what.
I figure getting a response to this is a long shot as this thread is rather old.
I previously used a tabbed dialog box to do this but I understand that using a property sheet should make saving the settings of all pages a snap which was previously very painful.
Thanks
-
February 11th, 2008, 06:22 AM
#29
Re: Need tutorial on Tab Controls in Windows API
See MSDN samples instead.
-
February 11th, 2008, 05:35 PM
#30
Re: Need tutorial on Tab Controls in Windows API
 Originally Posted by HwHack
I can get it to compile but when I run it the program exits immediately after briefly flickering a dialog window.
Could you be more specific? What can you get to compile? Did you do a debug build and see what is a reason for an application to exit prematurely?
Are you using Visual Studio? If yes, what version?
 Originally Posted by fred100
See MSDN samples instead.
Could you please elaborate? What sample?
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|