按钮设置位图

2020-10-08  本文已影响0人  fffwc

m_button.SetWindowTextW(_T("逃跑"));

CBitmap bitmap;

bitmap.LoadBitmapW(IDB_BITMAP1);

BITMAP bmp;

bitmap.GetBitmap(&bmp);

m_button.SetBitmap(bitmap);

m_button.MoveWindow(30, 30, bmp.bmWidth, bmp.bmHeight);

void MyButton::OnMouseMove(UINT nFlags, CPoint point)

{

// TODO:  在此添加消息处理程序代码和/或调用默认值

int x = rand() % 400;

int y = rand() % 300;

this->MoveWindow(x, y, 100, 166);

CButton::OnMouseMove(nFlags, point);

}

上一篇下一篇

猜你喜欢

热点阅读