荔园在线

荔园之美,在春之萌芽,在夏之绽放,在秋之收获,在冬之沉淀

[回到开始] [上一篇][下一篇]


发信人: scanf (carefully), 信区: SoftDev
标  题: [合集]请问高手一个问题!!!
发信站: 荔园晨风BBS站 (2004年09月26日09:35:33 星期天), 站内信件

☆   1  ──────────── 我是分割线 ─────────────────☆
发信人: tonye (i am back,but soon will go!~~~~), 信区: Visual
标  题: 请问高手一个问题!!!
时  间: Mon Dec  6 21:52:19 1999


 我已经通过MFC APPWIZARD生成一个可执行窗口程序,我想把窗口的背景颜色设置为其他
颜色,书上说是调用CDC类的SETBKCOLOR函数就可以了,但我找不到这个函数!我通过
EDIT 菜单的FIND IN FILES选项找SETBKCOLOR但找不到,请问各位如何才能找到这个
函数?还是要通过CLASSWIZAD生成这个函数,那又如何生成呢?



☆   2  ──────────── 我是分割线 ─────────────────☆
发信人: oasis (开始努力拉~~~~~~Never give up), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Mon Dec  6 22:13:06 1999

怎么会没有啊?MSDN里有写的啊
载录如下:
CDC::SetBkColor
virtual COLORREF SetBkColor( COLORREF crColor );
Return Value
The previous background color as an RGB color value. If an error occurs, the
 return value is 0x80000000.
Parameters
crColor
Specifies the new background color.
Remarks
Sets the current background color to the specified color. If the background
mode is OPAQUE, the system uses the background color to fill the gaps in sty
led lines, the gaps between hatched lines in brushes, and the background in
character cells. The system also uses the background color when converting b
itmaps between color and monochrome device contexts.
If the device cannot display the specified color, the system sets the backgr
ound color to the nearest physical color.




☆   3  ──────────── 我是分割线 ─────────────────☆
发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Mon Dec  6 23:09:49 1999

你还没有理解Windows的窗口!
CDC是要和窗口类一起用的,在使用时是要自己构造的!
      如才某个CView类的成员函数里:
           CDC ClientDC(this);
           ClientDC.SetBKColor(……);
      在OnDraw之类的成员函数的参数里系统会把一个CDC的指针传过来!



☆   4  ──────────── 我是分割线 ─────────────────☆
发信人: leewen (I believe I can fly), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Tue Dec  7 11:46:44 1999

我编写了一个文档/视结构的SDI程序,在CView类中的OnDraw函数中,
添加了如下代码:
        pDC->SetBkColor(...);
可是客户区背景颜色无法改变,始终是白色,不知哪里有问题?难道这个函数
不是这样用吗?
谁能解释一下吗?谢谢!



☆   5  ──────────── 我是分割线 ─────────────────☆
发信人: tonye (i am back,but soon will go!~~~~), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Tue Dec  7 13:54:23 1999


 你的意思是不是要自己构造SETBKCOLOR函数,是要自己在头文件里声明,定义......
 还是可以通过CLASSWIZARD直接生成SETBKCOLOR函数?




☆   6  ──────────── 我是分割线 ─────────────────☆
发信人: tonye (i am back,but soon will go!~~~~), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Tue Dec  7 14:07:47 1999


  我知道那里有介绍,但我不知道如何调用它!????




☆   7  ──────────── 我是分割线 ─────────────────☆
发信人: tang (独孤九剑〖玄铁重剑〗), 信区: Visual
标  题: Re: 请问高手一个问题!!!
时  间: Wed Dec  8 20:55:14 1999

我记得这个背景是画图形(如椭圆、矩形)、或输出字符等,填充空白区域的颜色!


[回到开始] [上一篇][下一篇]

荔园在线首页 友情链接:深圳大学 深大招生 荔园晨风BBS S-Term软件 网络书店