⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testlistbox.cpp

📁 can总线通信的 vc++例子
💻 CPP
字号:
// TestListBox.cpp : implementation file
//

#include "stdafx.h"
#include "TestListBox.h"
#include "resource.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CTestListBox

CTestListBox::CTestListBox()
{
}

CTestListBox::~CTestListBox()
{
}


BEGIN_MESSAGE_MAP(CTestListBox, CListBox)
	//{{AFX_MSG_MAP(CTestListBox)
	ON_WM_RBUTTONDOWN()
	ON_COMMAND(ID_MENU_REFRESH, OnMenuRefresh)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTestListBox message handlers

void CTestListBox::OnRButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	CMenu menu;
	menu.LoadMenu(IDR_MENU1);
	
	CMenu *submenu;
	submenu=menu.GetSubMenu(0);
	
	CPoint tmppoint=point;
	ClientToScreen(&tmppoint);
	submenu->TrackPopupMenu(TPM_LEFTALIGN|TPM_LEFTBUTTON,tmppoint.x,tmppoint.y,
		this);
	
	CListBox::OnRButtonDown(nFlags, point);
}

void CTestListBox::OnMenuRefresh() 
{
	// TODO: Add your command handler code here
	DWORD len=GetCount();
	for(DWORD i=0;i<len;i++)
		DeleteString(0);
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -