summary10 CToolTipCtrl、MoveWindow()、Combo-Box control、ShowWindow()、

本文详细介绍了如何在MFC中使用CToolTipCtrl为按钮添加工具提示,以及如何设置ComboBox控件的外观和选项。包括初始化、事件处理、窗口位置调整、控件显示与隐藏等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1.CToolTipCtrl

.h文件:

public:
	CButton m_btn;
	CToolTipCtrl m_save;

.cpp文件:OnInitDlg():

	m_save.Create(this);
	m_save.AddTool(GetDlgItem(IDC_BUTTON1), L"haha");
	m_save.Activate(TRUE);

添加virtual function:

BOOL CCToolTipCtrlDlg::PreTranslateMessage(MSG* pMsg)
{
	// TODO: Add your specialized code here and/or call the base class
	m_save.RelayEvent(pMsg);
	return CDialogEx::PreTranslateMessage(pMsg);
}

界面:

run:

2、m_btn.MoveWindow(CRect(50,100,80,120));//将button control 移动到这个位置。左上顶点和右下顶点。

3、combo-box control

添加一个combo box , Properties的Appearance中 type 设置成Drop List,sort设置成FALSE。

        m_combo.AddString(L"three");//添加下拉选项one
	m_combo.InsertString(0,L"one");//指定位置添加下拉选项
	m_combo.InsertString(1, L"two");
	m_combo.SetCurSel(0);//设置默认选项

run:

4、m_btn.ShowWindow(FALSE);//隐藏控件
    m_btn.ShowWindow(TRUE);//显示控件

5、FPS

定义:画面每秒传输帧数,图像每秒刷新次数。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值