Right-handed Property Sheet possible? 
Author Message
 Right-handed Property Sheet possible?

Is it possible to get the tabs on the right-hand side instead of the
left hand side of a property sheet.  I tried WS_EX_RIGHT using
ModifyStyleEx() but it had no effect.

Thank-you

Steve

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Sun, 23 Jun 2002 03:00:00 GMT  
 Right-handed Property Sheet possible?
Hi, Steve!

Here's the solution that I came up with a couple of weeks back. Derive a
class from CPropertySheet, and add a static member function to the class...

class CMySheet : public CPropertySheet
{
    .
    .
    .
    static int CALLBACK SheetCallBack(HWND hWnd, UINT msg, LPARAM lParam);

Quote:
};

Then add this stuff to the *.cpp implementation file...

#pragma pack(push, 1)

typedef struct {
    WORD   dlgVer;
    WORD   signature;
    DWORD  helpID;
    DWORD  exStyle;
    DWORD  style;
    WORD   cDlgItems;
    short  x;
    short  y;
    short  cx;
    short  cy;

Quote:
} DLGTEMPLATEEX, *LPDLGTEMPLATEEX;

typedef struct {
    DWORD  helpID;
    DWORD  exStyle;
    DWORD  style;
    short  x;
    short  y;
    short  cx;
    short  cy;
    WORD   id;

Quote:
} DLGITEMTEMPLATEEX, *LPDLGITEMTEMPLATEEX;

#pragma pack(pop)

int CALLBACK CMSheet::SheetCallBack(HWND hWnd, UINT msg, LPARAM lParam)
{
    if (msg == PSCB_PRECREATE && AfxIsValidAddress((void*)lParam, 512))
    {
        union {
            PVOID Void;
            DWORD dw;
            LPCSTR Char;
            LPCWSTR WChar;
            LPDLGTEMPLATE Template;
            LPDLGTEMPLATEEX TemplateEx;
            LPDLGITEMTEMPLATE Item;
            LPDLGITEMTEMPLATEEX ItemEx;
        }p; p.Template = (LPDLGTEMPLATE)lParam;

        while((p.Void = memchr(p.Void, 'S', (512-(p.dw - lParam)))) != NULL)
        {
            if (0 == wcscmp(p.WChar, L"SysTabControl32"))
            {
                if (((LPDLGTEMPLATEEX)lParam)->signature != 0xFFFF)
                {
                    p.dw -= sizeof(DLGITEMTEMPLATE);
                    p.Item->style |= (TCS_VERTICAL|TCS_RIGHT);
                }
                else
                {
                    p.dw -= sizeof(DLGITEMTEMPLATEEX);
                    p.ItemEx->style |= (TCS_VERTICAL|TCS_RIGHT);
                }
                break;
            }
            p.Char++;
        }
    }
    return TRUE;

Quote:
}

Modify the constructor like this...

CMySheet::CMySheet()
{
    m_psh.dwFlags |= PSH_USECALLBACK;
    m_psh.pfnCallback = &SheetCallBack;

    // back to normal CPropertySheet stuff...

    AddPage(&m_p1);
    AddPage(&m_p2);

Quote:
}

If you have any questions, don't hesitate to post a follow-up.

HTH,

Jeff...



Sun, 23 Jun 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to update right hand pane when item selected in left hand pane tree

2. Property Sheet within a Property Sheet

3. Property sheet from property sheet

4. Q: Property sheet within a property sheet

5. Possible to create property sheets without dialog templates???

6. What is a right hand pointing arrow?

7. (Q) Propsheets / Pages How to Rotate tabs From Top Two Right Hand Side

8. Adding to the system button on top right hand corner

9. Static splitter with right-hand pane fixed width

10. How to make a right-hand edit?

11. Property Sheet and Property pages in ATL

12. How to disable property page on property sheet.

 

 
Powered by phpBB® Forum Software