-
April 6th, 2015, 02:06 AM
#1
Need to delete earlier dynamic controls and redraw in a dialog
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;
}
-
April 6th, 2015, 08:26 AM
#2
Re: Need to delete earlier dynamic controls and redraw in a dialog
The counterpart to Create is DestroyWindow. What are you doing and why isn't it working?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|