| |

VerySource

 Forgot password?
 Register
Search
View: 836|Reply: 8

When a dialog box is nested, why is the sub-dialog box not displayed?

[Copy link]

2

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-3-4 14:30:01
| Show all posts |Read mode
Style is Child in Style
  Border is None
  Select Control in More Styles
  Control parent selected in Extended Styles

  Then add the child dialog class member CInsideDlg in the parent dialog, and add it in OnInitDialog
CInsideDlg m_child;
m_child.Create (IDD_DIALOG1, this);
//m_child.ShowWindow(0);
m_child.MoveWindow (10,20,20,10, TRUE);
    //m_child.ModifyStyle(0, WS_TABSTOP, 0);
m_child.ShowWindow (SW_SHOW);

There is no problem in compiling, but the main dialog box after execution does not display sub dialog boxes. What is the reason?
Reply

Use magic Report

0

Threads

55

Posts

32.00

Credits

Newbie

Rank: 1

Credits
32.00

 China

Post time: 2020-5-17 22:45:01
| Show all posts
too small?
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-5-18 17:00:01
| Show all posts
m_child.MoveWindow (10,20,20,10, TRUE);

You and this are not a correct rectangle

bottom must be greater than top
Reply

Use magic Report

2

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-5-20 08:30:02
| Show all posts
Thanks in advance.
Is it the reason above?
Why do I add a button to the sub-dialog box and "CANNOT ADD NEW MEMBER" appears when I double-click?
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-5-20 15:00:01
| Show all posts
Because the compiler cannot find a class that is combined with the dialog resource, you just add the message map by hand

Declare:
afx_msg void OnMyButtonClick ();

Map:
ON_COMMAND (Button ID, OnMyButtonClick)

void CMyDlg :: OnMyButtonClick ()
{
}
Reply

Use magic Report

0

Threads

10

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-5-20 22:30:01
| Show all posts
CInsideDlg m_child;
Put it in the .h file and see
Reply

Use magic Report

2

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-7-8 10:30:02
| Show all posts
CInsideDlg m_child; put it in the .h file
===============================================
this is not OK
Reply

Use magic Report

0

Threads

9

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-7-8 11:00:01
| Show all posts
Obviously not a rectangle
Reply

Use magic Report

2

Threads

7

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

 Author| Post time: 2020-7-27 20:30:01
| Show all posts
It's okay now. Thank you everyone!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list