本文主要介绍对话框背景色以及控件颜色的设置(SetDialogBkColor()不再被支持)。对话框背景色的设置1、重载OnPaint()函数,即WM_PAINT消息,代码如下所示:void CtestDlg::OnPaint(){ if (IsIconic()) { CP...
分类:
编程语言 时间:
2014-11-02 12:04:06
阅读次数:
261
1 在CPictureEx::OnPaint() 函数中2 将下面代码:3 ::BitBlt(dc.m_hDC, 0, 0, nPaintWidth, nPaintHeight, m_hMemDC, m_PaintRect.left, m_PaintRect.top, SRCCOPY);4 5 替....
分类:
其他好文 时间:
2014-10-21 13:48:54
阅读次数:
204
1 在OnPaint()函数中,添加以下代码:2 使用CDC:3 CDC *pDc = GetDC();4 pDc->FillSolidRect(客户区大小,RGB(255, 255, 255));5 或者使用CPaintDC dc(this);6 Dc.FillSolidRect(客户区大小,RG...
分类:
编程语言 时间:
2014-10-21 13:41:35
阅读次数:
189
public class ButtonX:Button { protected override void OnPaint(System.Windows.Forms.PaintEventArgs e) { ...
分类:
其他好文 时间:
2014-09-29 23:44:41
阅读次数:
307
Invalidate void Invalidate( BOOL bErase = TRUE ); 该函数的作用是使整个窗口客户区无效。窗口的客户区无效意味着需要重绘,例如,如果一个被其它窗口遮住的窗口变成了前台窗口,那么原来被遮住的部分就是无效的,需要重绘。这时Windows会在应用程序的消息.....
分类:
其他好文 时间:
2014-09-29 01:17:26
阅读次数:
337
void CJjjView::OnPaint() { CPaintDC dc(this); //屏幕初始化 dc.SetMapMode(MM_LOENGLISH);//0.01in ;1英寸映射 dc.SetTextAlign(TA_CENTER|TA_BOTTOM); ...
分类:
其他好文 时间:
2014-09-21 12:04:10
阅读次数:
292
很简单的东西,嘿嘿voidCTestDlg::OnPaint(){if(IsIconic()){CPaintDCdc(this);//用于绘制的设备上下文SendMessage(WM_ICONERASEBKGND,reinterpret_cast(dc.GetSafeHdc()),0);//使图标在...
分类:
其他好文 时间:
2014-09-15 10:00:08
阅读次数:
285
namespace MyTextBoxOne{ //使用时必须把文本框的BorderStyle为FixedSingle才能使用 //一些控件(如TextBox、Button等)是由系统进程绘制,重载OnPaint方法将不起作用. //所有这里并没有使用重载OnPaint方...
/// /// 可显示Gif 的窗体 /// public class WinGif : Form { private Image _img = null; public Image Img { g...
public class WindowOne:Form { public WindowOne() { InitializeCompnent(); } public void InitializeCompnent(...