当您在文本框内单击时,后台会发生什么?
在 MFC 对话框中,我有 2 行重叠的文本框(用户只能看到一行)。当我单击按钮时,我将底部的行向下移动,因此现在用户可以看到两行。
问题是,如果我在 DoDataExchange() 中为文本框加载了一些数据,则在对话框启动时我将无法看到它们显示。但是当我在文本框内单击时,数据就会显示。
我想知道当我点击 UI 时到底发生了什么?在后台调用哪些绘图函数?这样我就可以解决我的问题。
谢谢。 ZQ
Inside a MFC dialog, I have 2 overlapping rows of text boxes (what user can see is only one row). when I clicked a button, i shifted down the row at bottom, so now user can see both rows.
The problem is if I have some data loaded in DoDataExchange() for the text boxes, I wouldn't be able to see them showing when the dialog boots up. But when I click inside the text box, the data shows.
I want to know what exactly happen when I clicked a UI? What drawing functions are invoked at backgrounds? So I can fix my problem.
Thank you.
ZQ
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
单击时不会绘制任何内容,也许您会看到由于某种原因触发了 Invalidate() ,从而重新绘制了文本框。或者可能父控件(我认为是对话框)没有设置 WS_CLIPCHILDREN,或者 WS_CLIPXXX 标志发生了其他一些有趣的事情(它们有点像黑术)。
更重要的是,使用 Spy++ 检查单击时“发生”的情况 - 即在每个时间点发布的消息。
Nothing is drawn when you click, maybe you are seeing an Invalidate() being triggered for some reason that redraws the text boxes. Or maybe the parent control (dialog, I assume) doesn't have WS_CLIPCHILDREN set, or some other funny things are happening with the WS_CLIPXXX flags (they're somewhat of a black art).
More to the point, use Spy++ to check what 'happens' when you click - i.e. the messages that are posted at each point in time.