Home > Software engineering >  Be badly in need of help
Be badly in need of help

Time:09-22


I connect a Iist in the Tab Control Control controls, a list Control with Control checkbox, how do I realize the selection window, click the Tab Control list the contents of the space can be selection, a list Control with variable m_List

CodePudding user response:

Find m_ListCtrl
Void CxxxxDlg: : OnButton1 ()
{
//TODO: Add your the control notification handler code here
Int. All=m_ListCtrl GetItemCount ();
for(int i=0; i{
M_ListCtrl. SetItemState (I, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
}
M_ListCtrl. SetFocus ();
}

CodePudding user response:

M_ListCtrl attribute must be much choose!

CodePudding user response:

M_List. SetItemState (1, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);

CodePudding user response:

TCN_SELCHANGE

CodePudding user response:

All don't know what you said is refers to the check box selection or the entire line selection
1, if is a check box selection
 
For (int nIndex=0; NIndex & lt; M_List. GetItemCount (); NIndex++)
{
M_List. SetCheck (nIndex, TRUE);
}

2, if it is the entire line selection
 
For (int nIndex=0; NIndex & lt; M_List. GetItemCount (); NIndex++)
{
M_List. SetItemState (nIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
}

CodePudding user response:

TAB is selected to list send a message to update the list
  • Related