说三道四技术文摘-感悟人生的经典句子
说三道四 > 文档快照

如何改变对话框中控件的位置?

编辑:说三道四文库 发布时间:2017-06-27 08:16
HTML文档下载 WORD文档下载 PDF文档下载
我打算在我的程序中改变对话框中控件的大小,让控件的大小随着对话框改变而相应变化。我用GetClientRect()去得控件的位置信息,但只有right和bottom的值,left和top的值都是0。我想用MoveWindow()或者SetWindowPos()来重画控件,但只有right和bottom的值,只能确定宽度和高度,却无法确定位置。想请问各位大虾我应该怎么办呢?
你用ClientToScreen() 或则 ScreenToClient()转换一下,就有left 和 top了。
用 GetWindowsRect 试试,用GetClientRect当然left&top是0
你用MoveWindow()或者SetWindowPos()来重画控件的想法是对的,
但left和top的值都是0。是因为GetClientRect()得到的是控件的逻辑坐标,对控件而言,其left 和 top当然为0了!那怎么办呢?方法为:
(1)在你的控件中调用ClientToScreen()//将你的控件的rect转为Screen坐标
(2)在你的控件中调用GetParent()->ScreenToClient()//将Screen坐标转换为相对你的对话框Wnd的逻辑坐标!

注意“在你的控件中调用”这句话很有意义的,因为当前窗口对象不同,调用函数的意义不同,因为你的控件和你的对话框均为“CWnd对象”
MoveWindow
最简单的方法是:CRect rcWin;GetWindowsRect(&rcWin);即可!
mark
阿里将推无线领域重磅计划 阿里百川无线开放大会揭晓 提升网站转化率的四步优化方案 开发者应该了解的API技术清单! 【讲师】腾讯刘永峰:Docker时代,公有云面临的挑战和机遇 移动开发工具服务商Mob推出免费短信验证码SDK 遇见他们,MDCC 2014移动开发者大会嘉宾揭秘 揭秘全球最小无线耳机背后的技术 《最终幻想》之父访谈:我为何转战F2P游戏开发 寓教于乐 11款最适合教儿童编程的学习工具 苹果iPhone6获工信部许可 本月17日在内地发售 使用Redis之前5个必须了解的事情 妆媒体微信公众号背后的酸甜苦辣 TIOBE 2014年10月编程语言排行榜:Dart首次进入前20 Instagram工程师教你如何改善App的性能 利用Neo4j对电影评论进行深度学习情感分析 【简讯】SQLite 3.8.7来了 性能提升超50% 浏览器重定向性能分析经验谈 豆瓣工程副总裁段念:看板方法核心瞄准流程中的“流动性” 【图文实录】CTO俱乐部公开课:探讨如何成为技术团队管理者 资深产品交付咨询顾问何勉谈看板:“以价值拉动”解决敏捷困扰 开源HTML5游戏引擎Frozen背后的技术 MDCC 2014精彩日程、演讲嘉宾、参展开发团队全揭秘(图) Hi,约吗?2014华为开发者联盟沙龙(上海站)火热报名中! 找虐新方向!TinyScreen显示屏打造最小游戏机 精彩继续 MDCC2014首次推出技术训练营 复制器官哪家强?3D生物打印找PrintAlive 电信开放平台应用内计费SDK 助力App小额快捷支付 专心做设计!开源跨平台应用开发框架Appverse Mobile 无线盛宴尽在阿里百川开放大会 医学界的Instagram:加拿大重症监护医生开发照片分享应用 2014中国移动开发者大调查第二批获奖名单揭晓 有办法保证我的asp程序只能在一台指定的服务器上运行吗? 怎样将该段VB的代码传为C#(有关调用winAPI)? 关于Remoting的配置问题,高手帮忙! 关于安装系统的问题? 各位见笑了,对office不熟,在powerpoint里更改了母版并保存过了以后,怎么再改为不用母版? 高分讨教:如何控制用户的行为 高难度问题!!!~~~~~ 打开首页时,弹出另一窗口! 请问这个问题该怎么处理!十万火急!谢谢! 急:一个.Net 写DLL及调DLL的问题,请大家帮忙!(在线等候......可以再加分msn:w.hua@ynmail.com,qq:25857100) 救命啊 查找某个目录下是否有某个文件 邮箱命名的问题??? 怎样在一个窗口控件中显示两条自由报表的记录? 紧急求助USB带宽 请问哪里能下到《inside the c++ object model》英文版啊,谢谢 新手提问,大侠莫抛弃我,谢谢,请往里看。 求教:我想拦截CreateProcess()的调用,并取出参数是否可行???? 这是什么病毒 如何指定发送端口 如何设置treeview的scrollbar? 请问各位,谁写过一个程序的整个文档,小弟很急,想参考一下。不知是否可以。谢谢了! 打算过年后跳槽,大家帮帮忙看看我这水平能拿多少?来者有分 天灾 +人祸100分求救 各位再请看看: ccur(922337203685477.30)=922337203685477.25 ??? 用JAVA做APPLET程序的朋友请进!!! 如何使应用程序(基于对话框)在状态栏里不可见 急,求救!在线等!请帮忙,谢谢 SQL Server 的客户端问题? 在线等; 好好的程序不能运行了 ,提示:不能创建宏 怎样打开一个数据库在单文档的视中显示数据??(我没有没结过的贴) 调用外部程序的问题 偶去吃饭了!大家去吗?我请客好了:) 大家能不能介绍一下四川的迈普 VB6到VB.NET升级问题?有的FORM可以升级,有的不行,错误如下:(急!!!搞定立即散分!在线等!) 男人的花样,女人的年华(淡月儿) 如何在VB中正确将调用的Excel进程关闭? 请问 void UpdateDialogControls()函数怎么用……(******) 求教:我想拦截CreateProcess()的调用,并取出参数是否可行???? 我想请问一下sql的认证问题 触发器:For ,Instead OF 和After有什么区别?? slq7.0是不是不支持Instead OF 和After 远程访问方案征求!!! 为什么在我的XP的文件夹里面有Thumbs.db???? 不难的问题,请帮忙!! 如何改变ASP.NET Web应用程序生成的项目的位置?? 如何在JBuilder7中连接远程MS SQL2k数据库? 为什么在x-win32的窗口中,不能使用KDevelop,创建QT工程?? 数据源的连接问题?急!急!急!急!急!急!急!急!在线等待! paradox7表有没有最大记录数或最大容量?! 请问safety-critical systems是什么系统? 英语盲填The old man gets into mike's car,and they___off. the boy is (my brother) 对括号里的提问是什么? 晓凯的英文名怎么写或者是英文谐音也行 jump into the same car 翻译成汉语 句式转换:1、I like my classroom (because it is big and clean).(对括号提问)2、Most students do homework every day .(改一般疑问句)___ most students ____ ____ every day?3、After lunch ,I’ll go to sleep.(改否定句 中译英两个句子,注意时态Ⅲ急!1.如果你不想和我在一起,你就收拾东西走人.(pack up)2.战争时期,我受了很多苦.我用日记记下自己的经历,以便老了以后能够记住.(suffer;set down) 翻译句子bill hit his car into a wall last night I'd like to buy a big and modern house.________,I hope it's a quite neighborhood.A.After all B.Above all C.As a result D.At the moment就这个题,我说是选B,但是英语老师就是说选D,我也看见网上有这个题,就是选B,我去,这个 两个句子中译英1.和你交谈的目的是为了提高英语2.迟到的理由是起床晚了 It's __ that they will go there with me because they all like the place.A.necessaryB.certainC.impossibleD.wrong i would like to buy a big and modern house._____,i hope it is in a quiet neighborhood.after allabove allas a resultat that moment 中译英两个句子今天,我们将伴着春天的气息,敞开心扉.今天,我们将乘着青春的臂膀,放飞梦想.麻烦将这两句话准确翻译成英文, We like to live in tall buildings because we can be close to our fridens.Our new house is__(close)tWe like to live in tall buildings because we can be closeOur new house is__(close)to my school.1、第二句以适当形式填空2、为什么第一句 I like the room,______it is not big or bright.A.because B.so C.but 寒假打算回徐州学雅思课程,哪家好.我在南京上学,寒假回徐州打算学雅思课程,哪家机构有合适的课程? Who will go there and when they will go there ___not known.用is 还是 are 填 HE like art because it is fun.划线是because it is fun (对划线部分提问) my brother's name is (John) 针对括号部分提问? our love in the house什么意思? 我的理想是老师,写一篇《我的理想》,600字的,今天9要 英语定语从句The boy with whom John sopke is my brother.句中的whom为什么不可改为who 不是说who也可以用作宾语吗? 还是说这里应该用宾格,而我把宾语和宾格弄混了? Why does the third man get out of the waiting room的中文是什么? A man was travelling abroad in a small red car.One day he left thecar and went shopping.When he came back,its roof was badly damaged.Some boys told him that an elephant had damaged it.The man did not believe them,but they took him to a circus which w 约翰是我哥哥的名字 john is the ---- --- my brother 下面是一首歌的歌词,你能找出描写天气的单词吗?Oh,the weather is hot.And the sky is clear.It's a beautiful spot.This time of year.Oh,the weather is hot and the sky is clear.Oh,I'm never going to leave this place again.Oh,the clouds A man was traveling abroad in a small red car.One day he left the car and went shopping.When he c请问谁能帮我翻译一下呢?感激不尽! My brother is the boy with b____ e______. 用所给单词的适当形式填空 I__(see)the man __(go)out of the room and __(get)on a bus yesterday. The man started his car and drive away quickly.He was in a hurry. Could I take a few minutes of your time,doctor?帮忙翻译帮忙翻译一下,谢谢 They often go there with their books.(对划线部分提问)划线部分:their 【辨音】there they here where划线是ere,they的划线是ey 选择 today is __ teachers' day and __teachers in our school are all happyA.the,the B./,/ C.the,/ D./,the They are (burning rubbish there)( )中为划线部位划线部分提问 we have got [ ] juice [ ] our picnic .many\for enough\for much\away Japanese for kinds .Chinese is fun .our would in English .french for todayhhhhhhhh翻译 阅读判断对错:John doesn't like his house because it is very small and he hasn't hisown room.He is very happy to live in his uncle's home for the summer holiday.His uncle is very friendly to him.He lets John to stay up at night and John ca We have so many things for our picnic 什么意思 1.Peter出去一个小时了 (3句:过去时,系表结构现在完成时,句型)2.Lucy和John结婚5年了 (3句:同上)3.我去过上海3次了 (1句)4.他每天花两个小时写作业 (1句)5.学好一门外语不容易 (1句)6.许多国家讲 I went to see____ film named the Trojan War with my friends yesterday.I went to see__A__ film named the Trojan War with my friends yesterday.A.)a B.)an C.)the D.)/ ___A__ are you allowed to play on the computer in a week?A.)How long B.)How soon C.)Ho The house is worth--- because it dosen't cost much.A.being bought B.buying 为啥选B? 爸爸……英语怎样写 划分英语成分句子 yesterday my good friends and my family went to have picnic outside in the forest 英语一个根据首字母天单词PLEASE TAKE CARE OF EVERYTHING HERE,AND DON'T D( ) ANYTHING weather可以组成哪几个单词是 w e a t h e r 7个字母都要用啊 最少14个 写够14个 给高分啊7个字母都要用啊 Because of his careless,Jack hit his car into a big tree by the roadside的意思? Loook at the house ____ the tree .It is made ____ wood.The sound____ drill is so noisy.介词 They are long.They are smooth.Then have no tails.What are they?不是翻译。问题就是They are long.They are smooth.They have no tails.What are they? The car knocked into the post because of the driver's __.(care) there are always a lot of s___ in the shopping mall on the weekend When we stopped at the picnic place,we found some wood and ___to cook some food.A lighted the fireB lit a fire,选哪个,为什么,lighted也是过去式, Nobody noticed the thief slip into the house because the light happened to ---. 【The tall boy in the room】 is my brother 对话括号地方提问 There are tow parks in the citys.Children can visit them.改为定语从句的复合句 字母组词 urlnfodwe 关于天气的词 (The tallest boy) is my brother.对括号内部分提问.— — is_brother? When I was walking past the office,I heard some students____about the weekend picnic.A.talk B.talking C.talked D.to talk 求答案 求解析 He got into his car and drove down the road.翻译下 the boy is (tall)对括号中的单词发问并解答 my football socks are ___ out.how long have you __ them A worn,bought B wearing,had c Wearing bought D worn had
备案号:鲁ICP备13029499号-2 说三道四 www.s3d4.cn 说三道四技术文摘