Professional UI Solutions
Site Map   /  Register
 
 

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.

Forums » Prof-UIS General Discussion » Class initialization in ResizableChildSheet application Collapse All
Subject Author Date
Khoa Nguyen Tan Mar 1, 2004 - 7:15 AM

Hi,
Firstly, I’ve been using your library (freeware version) for a while and in my opinion, it’s one of the best.

Now I’m having fun with the ResizableChildSheet program and facing this problem:
+) When I add a derived class from CExtResizablePropertyPage which has a Tree Control inside, the tree control would not be initialized until the tab containing it has focus. Just until the tab has been focus (the funciton OnInitDialog is called) then I can access the tree control. However, in my program, I need to use that Tree Control to add information anytime even when that tab is not focused yet. I don’t know is there any mechanism to initialize the class (call OnInitDialog) at the same time that the class is created?

Best regard.

Sergiy Lavrynenko Mar 3, 2004 - 5:58 AM

Hi,


The property sheet pages are not initialized until the user activates them. This is the way of how the standard property sheet control is designed and we cannot change its internal code. You should change the design of your property sheet and initialize the tree after the tree-page is really created. But you can try the following:

  1. In the first page, which is created immediately after the property sheet starts, you can manually create and initialize an invisible tree window

  2. Initially the tree-page should not have the tree control at all, and when it is created you should get a HWND of the tree control inside the first page and invoke ::SetParent( hWndTreeControl, hWndNewParent ) with hWndNewParent being a HWND of the new parent window of your tree control (it is the HWND of the new parent property page of your tree control)

  3. Additionally, if you move the tree control to another page, you need to show the control and set its appropriate position


Best regards, Sergiy.

Khoa Nguyen Tan Mar 4, 2004 - 7:46 PM

Thanks for you answer.

I’m trying with your solution but I’m not very clear about it (i’m just novice).
If it doesn’t take you time, could you please send me a small application (of course source code :->).

Best regards. Thanks.