Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Chris Anderson
|
May 6, 2009 - 11:32 AM
|
I’m wondering if there is a quick way to skin a MFC based dialog. I can use CExtResizableDialog to skin the dialog itself, but need to manually subclass the controls ( button, edit, check box ... ) to skin the controls. Is there sort of wizard that can import a dialog from resource file and automatically generate the code ? Thanks
|
|
Technical Support
|
May 6, 2009 - 12:42 PM
|
The CExtResizableDialog class has a themed client area, a resizing gripper and the default non-client area. So, you can use the CExtNCW < CExtResizableDialog > class. There are several ways to skin all the dialog controls automatically:
1) InvokeSetAutoSubclassChildControls(); in your dialog’s constructor.
2) Invoke SubclassChildControls(); in your dialog’s OnInitDialog() virtual method.
3) Invoke the ::SubclassChildControls(HWND); global function in your dialog’s OnInitDialog() virtual method.
The first method remembers that dialog should apply the second method just after loading dialog template resource. The second method uses the third one.
This will subclass all the un-subclassed yet dialog controls with dynamic instances of Prof-UIS classes. You may have some dialog controls explicitly subclassed in your code. The class names of these controls should be manually replaced with Prof-UIS class names.
|
|
Chris Anderson
|
May 6, 2009 - 1:13 PM
|
Thank you for the quick response. It works very well
|
|