大约有 43,900 项符合查询结果(耗时:0.0941秒) [XML]
passing xxx as \'this\' argument of xxx discards qualifiers - C/C++ - 清泛网 - 专注C/C++及内核技术
...员
return name;
}
};
inline bool operator< (StudentT s1, StudentT s2) {
return s1.getId() < s2.getId();
}
int main() {
set<StudentT> st;
StudentT s1(0, "Tom");
StudentT s2(1, "Tim");
st.insert(s1);
st.insert(s2);
set<StudentT> :: iterator ...
error: cannot dynamic_cast ‘b’ (of type ‘class Base*’) to type ‘c...
...T raw() {return _val;}
};
int main()
{
Base * b = new Derived<int>(1);
Derived<int> * d = dynamic_cast<Derived<int>* >(b);
cout << d->raw() << endl;
return 0;
}
dynamic_cast
MFC Static透明背景色的实现、Static控件自绘、Static字体修改 - C/C++ - ...
...文件
CFont *pFont, *pOldFont;
pFont = ::GetFont(_T("微软雅黑"), 10);
pOldFont = pDC->SelectObject(pFont);
pDC->TextOut(0, 0, szText);
pDC->SelectObject(pOldFont);
pDC->RestoreDC(nSaveDC);
}
这种采用完全自绘的方式更为灵活,可以改变字体、文本颜色等...
MFC RoundRect、FillRect等函数如何设置颜色 - C/C++ - 清泛网 - 专注C/C++及内核技术
...lSolidRect) 颜色:
CPen mypen, *oldpen;
mypen.CreatePen(PS_SOLID, 1, m_clrFrame);
oldpen = pDC->SelectObject(&mypen);
CPoint point(7, 7);
pDC->RoundRect(rectEdit, point);
pDC->SelectObject(oldpen);
CDC中FillRect与FillSolidRect的区别:
在网上找FillRect与FillSolidRe...
VC 对话框背景色覆盖CEdit背景色的解决方法 - C/C++ - 清泛网 - 专注C/C++及内核技术
...单个控件进行特殊设置:
if(pWnd->GetDlgCtrlID() == IDC_STATIC1)
...
MFC 对话框 背景色 CEdit
VC IP地址控件(CIPAddressCtrl )的自绘 - C/C++ - 清泛网 - 专注C/C++及内核技术
...色
m_clrFrame = RGB(228, 228, 228); //边框颜色
m_clrText = RGB(174, 174, 174); //文字颜色
m_brushBkg.CreateSolidBrush(m_clrBackground); //创建背景画刷
m_pfDefault = ::GetFont(_T("微软雅黑"), 12);
}
CMyIPCtrl::~CMyIPCtrl()
{
}
BEGIN_MESSAGE_MAP(CMyIPCtrl, CIP...
Picture Control(图片控件)中静态显示位图,解决位图不显示的问题 - C/C++ ...
...静态显示位图,代码如下:
void CShowBmpDlg::OnBnClickedButton1()
{
//从资源中加载图片
CBitmap bitmap;
//加载指定位图资源 Bmp图片ID
bitmap.LoadBitmap(IDB_BITMAP1);
//获取对话框上的句柄 图片控件ID
CStatic *p=(CStatic *)GetDlg...
MFC 日期时间控件CDateTimeCtrl自绘 - C/C++ - 清泛网 - 专注C/C++及内核技术
...绘先看效果:方法同ComboBox自绘(http: www.tsingfun.com html 2016 code_1110 100.html),采用图片拼接的方式,本例实现较基础仍有细节待...先看效果:
方法同ComboBox自绘(https://www.tsingfun.com/down/code/100.html),采用图片拼接的方式,本...
MFC SetCursor设置手型鼠标光标 - C/C++ - 清泛网 - 专注C/C++及内核技术
...ouseMove(nFlags, point);
int nIndex = HitTest(point);
if ( nIndex > -1 )
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_HAND)); //手型光标
...
}
else
{
SetCursor(AfxGetApp()->LoadStandardCursor(IDC_ARROW)); //普通箭头光标
...
}
...
}
IDC_APPSTARTIN...
OnMouseMove nFlags的作用 - C/C++ - 清泛网 - 专注C/C++及内核技术
...。
注:point是相对位置,例如当窗口的左上角坐标为(10,10)那么当鼠标在屏幕的(10,10)像素点的时候,OnMouseMove函数point值为(0,0)因为是相对窗口左上角的相对位置。
定义参考如下:
#ifndef NOKEYSTATES
/*
* Key State Masks ...
