Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dialog box problme in MFC please help me

Status
Not open for further replies.

Vallurupa

Programmer
Oct 17, 2001
38
US

I have to make dialog box. Inside that dialog box one side that I have to have Tree view control one side of the screen. The otherside of the screen i have to insert another dialog. When i click on the tree view items i have to get the corospnding dialog box in the otherside of the screen.

Is it possible to have dialog in side the dialog box. Please help me.

Thanks

Venkat
 
Why do you want it to be a dialog? Why can't it just be a child window?
Greetings,
Rick
 
Hi Rick,
Thanks for the suggession. How to reserve the space on the dialog box to show the chaild window on it. I mean waht control should I use on the main dialog. Please help me

Thank you
venkat
 
You could use the static frame, or just use CreateWindow to generate your own window. But the first option is easier...
Greetings,
Rick
 
Rick,

Would you be able to explain that a little more?

Thanks.
 
My problem is similar: I have a CFormView-derived view with a tree view on the left and empty space on the right for another CFormView-derived form. How do I display the second form on the right side?
 
Once you change a dialogs style to WS_CHILD rather than WS_POPUP it is just another "window" so you can do all the things with it that you can with any "window".

-pete
 
Well, you could create a window using the CreateWindow API and specify the dialog as its parent window, create controls on it etc. This is a lot of work, but you can do whatever you like; it's all in your control.

Then, when you've created some of these windows, you can switch between them by showing and hiding them.
Greetings,
Rick
 
Hi rick,

I am not getting this.. I am trying to chage the application from property views to the tree view. I have 6 different screens. When i click on the tree view. the correcponding screen should pop up in the other side of the screen. Thats what i am trying to do. But the things is.. I do not understand how should i get the dialog in side the dialog and how should i capture the events when i click on the tree view levels.

Please reply me

Thanks
venkat
 
It's just like palbano said; use a window with the WS_CHILD style instead of WS_POPUP. Set your dialog as the parent and it will be drawn inside your dialog (just like, for example, a textbox). I'm not sure if you can use an MFC dialog class for this easily, but maybe its possible with the FormView dds82 is using and, if not, you can always create your own window. Handling events would be done in the window procedure of that window (WM_NOTIFY, WM_COMMAND and such). It's a bit more work, but maybe it can be done.

And I have to correct myself on the static frame; I'm not sure if the static frame supplied by the toolbox is an actual control container (like the one in VB).
Greetings,
Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top