• 大小: 126KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: 其他
  • 标签:

资源简介

以重载方式响应CListBox右键,为回答网友问题的资源,不知道为什么上一次没传上去。

资源截图

代码片段和文件信息

// MyList.cpp : 实现文件
//

#include “stdafx.h“
#include “TestListBoxRButton.h“
#include “MyList.h“


// CMyList 对话框

IMPLEMENT_DYNAMIC(CMyList CListBox)

CMyList::CMyList(CWnd* pParent /*=NULL*/)
: CListBox()
{

}

CMyList::~CMyList()
{
}

void CMyList::DoDataExchange(CDataExchange* pDX)
{
CListBox::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CMyList CListBox)

ON_WM_RBUTTONUP()
END_MESSAGE_MAP()




void CMyList::OnRButtonUp(UINT nFlags CPoint point)
{
int nIndex = GetCurSel();
if (nIndex < 0 || nIndex >GetCount())
{
MessageBox(TEXT(“没有选择listbox项“));
return;
}
DeleteString(nIndex);

CListBox::OnRButtonUp(nFlags point);
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      88064  2013-10-10 11:11  TestListBoxRButton\Release\TestListBoxRButton.exe

     文件        705  2013-10-10 11:09  TestListBoxRButton\TestListBoxRButton\MyList.cpp

     文件        432  2013-10-10 11:08  TestListBoxRButton\TestListBoxRButton\MyList.h

     文件       3067  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\ReadMe.txt

    .......     67777  2007-11-28 16:21  TestListBoxRButton\TestListBoxRButton\res\TestListBoxRButton.ico

     文件        374  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\res\TestListBoxRButton.rc2

     文件        736  2013-10-10 10:06  TestListBoxRButton\TestListBoxRButton\resource.h

     文件        151  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\stdafx.cpp

     文件       1854  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\stdafx.h

     文件       1030  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\targetver.h

     文件       1809  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\TestListBoxRButton.cpp

     文件        517  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\TestListBoxRButton.h

     文件       5351  2013-10-10 10:07  TestListBoxRButton\TestListBoxRButton\TestListBoxRButton.rc

     文件       5714  2013-10-10 10:56  TestListBoxRButton\TestListBoxRButton\TestListBoxRButton.vcproj

     文件       3871  2013-10-10 11:09  TestListBoxRButton\TestListBoxRButton\TestListBoxRButtonDlg.cpp

     文件        774  2013-10-10 10:57  TestListBoxRButton\TestListBoxRButton\TestListBoxRButtonDlg.h

     文件        920  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton.sln

     目录          0  2013-10-10 09:57  TestListBoxRButton\TestListBoxRButton\res

     目录          0  2013-10-10 11:11  TestListBoxRButton\Release

     目录          0  2013-10-10 11:12  TestListBoxRButton\TestListBoxRButton

     目录          0  2013-10-10 11:12  TestListBoxRButton

----------- ---------  ---------- -----  ----

               183146                    21


评论

共有 条评论

相关资源