MFC下获取控件相对于子窗口的矩形位置
2013-10-25 11:48
381 查看
要获取控件在子窗口下的矩形位置。
下程序为在子窗口的类下写的。
CRect rectPlot,rectWnd;//左为用于存控件的矩形,右为用于存子窗口的矩形 GetWindowRect(rectWnd);//取子窗口rect GetDlgItem(IDC_STC_PLOT)->GetWindowRect(&rectPlot);//取控件rect rectPlot.top=rectPlot.top-rectWnd.top; rectPlot.left=rectPlot.left-rectWnd.left; rectPlot.right=rectPlot.right-rectWnd.left; rectPlot.bottom=rectPlot.bottom-rectWnd.top;//相减求得
方法很笨,但没想到其它方法,先顶着用。
相关文章推荐
- 安装、重装MySQL时,出现could not start the service mysql error:0的解决办法
- GoLang 连接MySQL 实现查询
- WWDC2013_218 内容概要 ( 2 )
- spring组件扫描<context:component-scan/>使用详解
- Android 4.0的图形硬件加速及绘制技巧
- ORACLE中获得受影响记录行数
- SQL查询语句调优技巧
- linux 启动oracle 命令
- zoj 2111 Starship Troopers(树形DP)
- Java线程:线程的交互
- MAX中制作空心圆柱/管道
- 日期时间函数datediff、与celling
- windows下的dos窗口下vim 乱码解决
- tomcat 闪退 起不来
- Log4j的配置文件
- GridView表格列数据字符截取
- JAVA在FTP服务器上直接生成文本文件
- Leetcode: Reverse Nodes in k-Group
- Qt QListWidget 以缩略图的形式显示
- linux更改主机名