ClistCtrl
-
i have a question i hava a ClistCtrl control in a modal dialog box (report type). Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before. Thank you.
-
i have a question i hava a ClistCtrl control in a modal dialog box (report type). Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before. Thank you.
This is already done for you and depends on the life time of the dialog object. Also update the list control in a callable method other than
OnInitDialog
. So each time you callDoModal
, it will be on the same object of the dialog class.«_Superman_»
I love work. It gives me something to do between weekends. -
i have a question i hava a ClistCtrl control in a modal dialog box (report type). Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before. Thank you.
alexander 1983 wrote:
Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before.
Keep the values in some sort of container (e.g., list, array).
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
-
i have a question i hava a ClistCtrl control in a modal dialog box (report type). Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before. Thank you.
What others said is right. You have to store the data - the data that's supposed to be shown - elsewhere and in order to show that data in the control, you have to feed that, may be through the dialog object, may be something like this.
CMyDialog : public CDialog
{
public:
CMyDialog(CListCtrlData *pd):m_pd(pd)...
BOOL OnInitDialog(...)
{
//...
// fill the list ctrl with the data
//...
}
private:
CListCtrlData *m_pd;
};CListCtrlData gDataA;
void SomeFunction()
{
CMyDialog dlg(&gDataA);
dlg.DoModal();
}CListCtrlData gDataB;
void SomeOtherFunction()
{
CMyDialog dlg(&gDataB);
dlg.DoModal();
}If the data is supposed to be editable, just make sure that your data class has appropriate methods to update and call these methods from the relevant event handlers for the control.
byte till it megahurtz
-
i have a question i hava a ClistCtrl control in a modal dialog box (report type). Anyone knows how to make ClsiCtrl keep the values entered after closing the dialog box?when reopening the dialog the control to display the data entered before. Thank you.