Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Help: Tab Control (API)

I have been doing all I can to make a tab control use a dialog resource.
There are 3 dialog resources as mainDlg, oneDlg, twoDlg as below:

[code]
IDD_MAINDLG DIALOGEX 0, 0, 500, 400
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION

Comments

  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : I have been doing all I can to make a tab control use a dialog
    : resource.
    : There are 3 dialog resources as mainDlg, oneDlg, twoDlg as below:
    :
    : [code]:
    : IDD_MAINDLG DIALOGEX 0, 0, 500, 400
    : STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
    : EXSTYLE WS_EX_APPWINDOW
    : CAPTION
  • way0endway0end Member Posts: 43
    well, this is what I have been doing to overcome and wish to stick with it.

    so please any help... many thanks,
  • AsmGuru62AsmGuru62 Member Posts: 6,519
    : well, this is what I have been doing to overcome and wish to stick
    : with it.
    :
    : so please any help... many thanks,

    [color=Blue]You just need to do all the work which PropertySheet does:

    1. Dialog 1 and 2 (tab pages) should be created as modeless dialogs (use CreateDialog() API:

    [link=http://msdn.microsoft.com/en-us/library/ms645434(VS.85).aspx]http://msdn.microsoft.com/en-us/library/ms645434(VS.85).aspx[/link])

    2. Both pages should be children of the main dialog.
    3. First page should be created visible. Other pages - not visible.
    4. Do not forget the IsDialogMessage() - without it will be no proper keyboard navigation.

    5. If your main dialog is resizable - first resize tab control to fit all area (use MoveWindow() or SetWindowPos() APIs). Then use TCM_GETITEMRECT message to get the proper area for a child dialog. Then resize child dialog for active tab item to that area.

    6. Respond to TCN_SELCHANGING notification by hiding the active child dialog and respond to TCN_SELCHANGE notification by activating proper child dialog. It is better to attach child dialog handles as tab control item data.

    I may have forgotten some details, but that's your debugging work will figure it out.
    [/color]
Sign In or Register to comment.