Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3029

Need to delete earlier dynamic controls and redraw in a dialog

$
0
0
Name:  SampleApp.jpg
Views: 263
Size:  30.6 KB

I've created a dialog based MFC app which input from user to create that many dynamic controls(Used checkbox to be created dynamically).

After user input that many checkboxes controls are created but if try to click again then not able to delete previous controls and again new no. of controls.
Code snippet to add controls on usre input.
RECT rctA;
rctA.top = 51;
rctA.bottom = 80;
CString temp;
m_Edit.GetWindowText(temp);
int noOfControls = _tstoi(temp);

for(int i=0;i < noOfControls; ++i)
{
m_CheckBox[i].Create(_T(""), WS_CHILD|WS_VISIBLE|BS_AUTOCHECKBOX ,
CRect(10,rctA.top,30,rctA.bottom ), this, 1+i);
rctA.top+=30;
rctA.bottom+=30;
}
Attached Images
 

Viewing all articles
Browse latest Browse all 3029

Latest Images

Trending Articles



Latest Images