Click here to Skip to main content
15,886,258 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Niklas L27-Feb-11 23:35
Niklas L27-Feb-11 23:35 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Le@rner27-Feb-11 23:55
Le@rner27-Feb-11 23:55 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Richard MacCutchan28-Feb-11 0:55
mveRichard MacCutchan28-Feb-11 0:55 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Cool_Dev28-Feb-11 1:00
Cool_Dev28-Feb-11 1:00 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Richard MacCutchan28-Feb-11 1:12
mveRichard MacCutchan28-Feb-11 1:12 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Cool_Dev28-Feb-11 1:59
Cool_Dev28-Feb-11 1:59 
GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Richard MacCutchan28-Feb-11 6:00
mveRichard MacCutchan28-Feb-11 6:00 
GeneralRe: How can handle double click event in listctrl of checkbox style? [modified] Pin
Cool_Dev27-Feb-11 23:57
Cool_Dev27-Feb-11 23:57 


Use CListCtrl::GetItemRect and ptAction member of LPNMITEMACTIVATE structure.

void MyDlg::OnDblClick(NMHDR* pNMHDR, LRESULT* pResult)
{
    LPNMITEMACTIVATE pNMIA = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR);

    int nItem = -1;
    int nSubItem = -1;

    if (pNMIA)
    {
        nItem = pNMIA->iItem;
        nSubItem = pNMIA->iSubItem;
    }

    if (nItem >= 0 && nSubItem >= 0)
    {
        CRect rect;
	m_list.GetItemRect(nItem, &rect, LVIR_LABEL );
	if(pNMIA->ptAction.x < rect.left) // For left aligned check box.
	{
	  MessageBox("Double Clicked on CheckBox");
	}
    }

    *pResult = 0;
}


Another alternative is CListCtrl::HitTest() function.

modified on Monday, February 28, 2011 6:56 AM

GeneralRe: How can handle double click event in listctrl of checkbox style? Pin
Le@rner28-Feb-11 0:20
Le@rner28-Feb-11 0:20 
QuestionGetComboBoxInfo implementation Pin
mesajflaviu27-Feb-11 20:05
mesajflaviu27-Feb-11 20:05 
AnswerRe: GetComboBoxInfo implementation Pin
Andrew Brock27-Feb-11 21:28
Andrew Brock27-Feb-11 21:28 
GeneralRe: GetComboBoxInfo implementation Pin
mesajflaviu27-Feb-11 22:27
mesajflaviu27-Feb-11 22:27 
GeneralRe: GetComboBoxInfo implementation Pin
mesajflaviu27-Feb-11 22:29
mesajflaviu27-Feb-11 22:29 
QuestionBest Algorithm to merge two tree structured object? [modified] Pin
yogish29327-Feb-11 19:54
yogish29327-Feb-11 19:54 
QuestionHoe to get Alpha value of pixels of a bitmap image... [modified] Pin
Amrit Agr27-Feb-11 19:27
Amrit Agr27-Feb-11 19:27 
GeneralRe: Hoe to get Alpha value of pixels of a bitmap image... Pin
Richard MacCutchan27-Feb-11 22:24
mveRichard MacCutchan27-Feb-11 22:24 
QuestionHelp on the encryption decryption project. Pin
gateway2327-Feb-11 5:15
gateway2327-Feb-11 5:15 
AnswerRe: Help on the encryption decryption project. Pin
Hans Dietrich27-Feb-11 5:46
mentorHans Dietrich27-Feb-11 5:46 
AnswerRe: Help on the encryption decryption project. Pin
Richard MacCutchan27-Feb-11 6:15
mveRichard MacCutchan27-Feb-11 6:15 
AnswerRe: Help on the encryption decryption project. Pin
Stephen Hewitt27-Feb-11 17:58
Stephen Hewitt27-Feb-11 17:58 
QuestionIs gdi+ started? How to check? Pin
VernonM26-Feb-11 13:18
VernonM26-Feb-11 13:18 
AnswerRe: Is gdi+ started? How to check? PinPopular
Hans Dietrich26-Feb-11 14:03
mentorHans Dietrich26-Feb-11 14:03 
QuestionCButton click Pin
goorley24-Feb-11 23:23
goorley24-Feb-11 23:23 
AnswerRe: CButton click Pin
Hans Dietrich24-Feb-11 23:54
mentorHans Dietrich24-Feb-11 23:54 
AnswerRe: CButton click PinPopular
Cool_Dev25-Feb-11 0:49
Cool_Dev25-Feb-11 0:49 

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.