MFC uses the WebBrowser component to create a scroll view in the dialog box, dynamically create a static text control, and set the message response with the mouse clicked. mfcwebbrowser
MFC Applet:
1. Simple WebBrowser ActiveX plug-in method in MFC:
See blog: http://blog.csdn.net/supermanking/article/details/5866213
2. Create a view in the dialog box (a scroll view is created here ):
See blog: http://blog.csdn.net/clever101/article/details/4873994
Http://blog.csdn.net/clever101/article/details/3779089
3. dynamically create controls and add message responses (here is a static text control and click message response for it)
See blog: http://blog.csdn.net/shuaiby/article/details/8537908
Download the program source code (the program source code is for reference only. Do not spread it online );
Http://download.csdn.net/detail/lp310018931/7994877 (5 points required for downloading)
By http://blog.csdn.net/lp310018931
How does vs2008 MFC add static text and text box controls in the dialog box?
Open the dialog box to be edited in the resource view, and then open the floating window of the Toolbox through "View"-"toolbox". There are various controls in the toolbox, including static text and text box controls.
In MFC, how do I add static text controls and edit box controls to the status bar?
Dynamic header file creation declaration:
CEdit * m_Edits;
In the OnInitDialog function of the cpp file:
M_Edits = new CEdit (50 );
For (int I = 0; I <50; I ++)
{
M_Edits [I]. Create (......);
}
When the program execution ends:
For (int I = 0; I <50; I ++)
{
Delete [] m_Edits;
}
However, this situation only applies to the regular arrangement of all the Edit controls in the dialog box. If not, use the following method:
Declare a CEdit array with enough elements in the header file:
CEdit m_Edit [50]; // suppose you have placed 50 Edit controls in advance
Find the DoDataExchange (CDataExchange * pDX) function in the dialog box and add the following code:
DDX_Control (pDX, IDC_XXX, m_Edit [0]);
DDX_Control (pDX, IDC_YYY, m_Edit [1]);
........................
IDC_XXX and IDC_YYY are the ID of each Edit
In this way, you can manually add all the edit boxes and then access them using arrays.