Click here to Skip to main content
15,891,316 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCrash in GetMessage method of windows. Pin
Kundan Kumar Bharti3-Sep-09 19:47
Kundan Kumar Bharti3-Sep-09 19:47 
AnswerRe: Crash in GetMessage method of windows. Pin
Cedric Moonen3-Sep-09 20:13
Cedric Moonen3-Sep-09 20:13 
QuestionFind UpDown Control in a dialog box Pin
Bedke3-Sep-09 18:56
Bedke3-Sep-09 18:56 
AnswerRe: Find UpDown Control in a dialog box Pin
«_Superman_»3-Sep-09 19:26
professional«_Superman_»3-Sep-09 19:26 
GeneralRe: Find UpDown Control in a dialog box Pin
Bedke3-Sep-09 19:47
Bedke3-Sep-09 19:47 
GeneralRe: Find UpDown Control in a dialog box Pin
«_Superman_»3-Sep-09 20:50
professional«_Superman_»3-Sep-09 20:50 
GeneralRe: Find UpDown Control in a dialog box Pin
Bedke3-Sep-09 21:28
Bedke3-Sep-09 21:28 
QuestionQuestion for CCheckListBox. Pin
Le@rner3-Sep-09 18:51
Le@rner3-Sep-09 18:51 
Hi all,

I m using a ListBox and add Variable for this that is CCheckListBox type.
there is 4 items,and i m also use a Check box that is use to select and deselct all items of ListBox.
i m handle it over ON_LBN_SELCHANGE of ListBox and Click event of Check box.

selection and deselection from Checkbox working fine.

but problem occur when i use it by List box means, iwant when the all items of list box checked than Select all Check box automatically Checked or vice-versa.

but i have one problem when i continous click on listbox its not working fine.

//------------------------------------------------------------------------------------------
//Check box Click event
CButton m_sel_all_chk;//Chek box
CCeckListBox m_col_lb;

void CExcel_Info_Dlg::OnBnClickedCheckSelAll()
{
	if(m_sel_all_chk.GetCheck()==1)
	{
		for(int i=0;i<m_col_lb.GetCount();i++)
		{
			m_col_lb.SetCheck(i, 1);
		}
	}
	else if(m_sel_all_chk.GetCheck()==0)
	{
		for(int i=0;i<m_col_lb.GetCount();i++)
		{
			m_col_lb.SetCheck(i, 0);
		}
	}
}
//------------------------------------------------------------------------------------------

//ON_LBN_SELCHANGE 

//------------------------------------------------------------------------------------------
void CExcel_Info_Dlg::OnLbnSelchangeListColumns()
{
	BOOL flag;
	flag=FALSE;

	int count=m_col_lb.GetCount();

	for(int i=0;i<count;i++)
	{
		if(m_col_lb.GetCheck(i)==0)
		{
			flag=TRUE;
			break;
		}
	}
	if(flag==FALSE)
	{
		m_sel_all_chk.SetCheck(1);
	}
	else
	{
		m_sel_all_chk.SetCheck(0);
	}
	
}
//------------------------------------------------------------------------------------------


so please help me for this.

thanks in advance.

To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.

AnswerRe: Question for CCheckListBox. Pin
David Crow4-Sep-09 2:54
David Crow4-Sep-09 2:54 
GeneralRe: Question for CCheckListBox. Pin
Le@rner4-Sep-09 2:58
Le@rner4-Sep-09 2:58 
GeneralRe: Question for CCheckListBox. Pin
David Crow4-Sep-09 3:11
David Crow4-Sep-09 3:11 
QuestionProblem with reading a file Pin
Rakesh53-Sep-09 17:43
Rakesh53-Sep-09 17:43 
AnswerRe: Problem with reading a file Pin
«_Superman_»3-Sep-09 17:50
professional«_Superman_»3-Sep-09 17:50 
AnswerRe: Problem with reading a file Pin
Cedric Moonen3-Sep-09 20:14
Cedric Moonen3-Sep-09 20:14 
AnswerRe: Problem with reading a file Pin
shuzh3-Sep-09 20:52
shuzh3-Sep-09 20:52 
GeneralRe: Problem with reading a file Pin
Michael Schubert3-Sep-09 21:19
Michael Schubert3-Sep-09 21:19 
AnswerRe: Problem with reading a file Pin
Michael Schubert3-Sep-09 21:24
Michael Schubert3-Sep-09 21:24 
AnswerRe: Problem with reading a file Pin
David Crow4-Sep-09 2:56
David Crow4-Sep-09 2:56 
AnswerRe: Problem with reading a file Pin
kakan4-Sep-09 3:08
professionalkakan4-Sep-09 3:08 
QuestionUpdating UI from thread Pin
_80863-Sep-09 16:54
_80863-Sep-09 16:54 
AnswerRe: Updating UI from thread Pin
«_Superman_»3-Sep-09 17:20
professional«_Superman_»3-Sep-09 17:20 
GeneralRe: Updating UI from thread Pin
_80863-Sep-09 17:39
_80863-Sep-09 17:39 
GeneralRe: Updating UI from thread Pin
«_Superman_»3-Sep-09 17:45
professional«_Superman_»3-Sep-09 17:45 
AnswerRe: Updating UI from thread Pin
Cedric Moonen3-Sep-09 20:03
Cedric Moonen3-Sep-09 20:03 
AnswerRe: Updating UI from thread Pin
Rajesh R Subramanian3-Sep-09 20:16
professionalRajesh R Subramanian3-Sep-09 20:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.