在MFC中使用HITTEST方法 [英] use of HITTEST METHOD in MFC

查看:308
本文介绍了在MFC中使用HITTEST方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生/妈妈,我对MFC很陌生,谁能解释如何使用HitTest方法以及该方法的用途.我们可以用它来选择特定的客户区吗?例如我在客户区画了文字.已经从LButtonDown和LButtonUP以及MouseMove中获取了两个点,并以此点绘制了矩形.现在我想更改矩形的bkcolor ....请注意,我没有使用editview,请任何人帮助我........


在此先感谢
sarfaraz

解决方案

1.要更改背景色,请使用FillRect方法,

void FillRect(LPCRECT lpRect,CBrush* pBrush);

从LButtonDown,LButtonUP点生成矩形.下面的链接为您提供有关FillRect的更多信息.
http://msdn.microsoft.com/en-us/library/0421fewx%28v = vs.80%29.aspx [ ^ ]

2. HitTest的行为取决于您所引用的窗口.它不是CWnd成员.


hi sir/ mam i am very new to MFC can any one explain how to use HitTest method and what are the uses of it. can we use it for selecting the particular client area.for example i had drawn the text in the client area . had taken two point from LButtonDown and LButtonUP and also the MouseMove and drawn the rectangle by this point. now i want to change the bkcolor of the rectangle .... note i did not taken the editview please any one help me ........


thanking in advance
sarfaraz

解决方案

1. To change back ground color use FillRect method,

void FillRect(LPCRECT lpRect,CBrush* pBrush);

Generate the rectange from LButtonDown, LButtonUP points.The following link gives you more information about FillRect.
http://msdn.microsoft.com/en-us/library/0421fewx%28v=vs.80%29.aspx[^]

2. The behaviour of HitTest will depends on the window you are refferening.It is not a CWnd Member.


这篇关于在MFC中使用HITTEST方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆