如何动态删除编辑控件的边框? [英] How to remove the edit control 's border dynamically?

查看:92
本文介绍了如何动态删除编辑控件的边框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在一个Dilag中,编辑控件具有默认边框,我想删除其边框,除了通过在属性板上进行设置外,没有其他方法,所以我想在运行时删除它,怎么办?


谢谢!

In a dilag, the edit control has a border default, I want to remove its border, there is no ways except by setting in the property board, so I want to remove it at runtimes, how to do?


Thanks!

推荐答案

m_wndEdit.ModifyStyleEx(WS_EX_CLIENTEDGE, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED);


MSDN是您的朋友.如果还没有安装,请安装它.在跳到网上提问之前先搜索一下.

您从属性板添加的所有UI元素都以代码形式显示在.rc文件中.在记事本中打开它(Visual Studio不显示文本版本)并进行分析.

这次我会回答您的问题,并记住我对未来的看法.

使用GetWindowStyle(...)获取现有样式.从中删除WS_BORDER标志,然后使用SetWindowStyle(...)将其重新设置.
MSDN is your friend. Install it if you don''t already have it. Search it before jumping to post a question on the net.

Any UI elements you add from the property board is present, as code, in the .rc file. Open that in the notepad (visual studio doesn''t display the textual version) and analyse.

I''ll answer your question this time and remember what I said for the future.

Get the existing style using GetWindowStyle(...). Remove WS_BORDER flag from it and set it back using SetWindowStyle(...).


属性中的任何设置都可以在代码中设置,实际上,它可能是在以下代码中设置的:由IDE生成.因此,我建议您查看自动生成的代码并查看其功能,一种简单的方法是复制您的项目,在IDE中进行更改,然后对两个项目进行比较,找出哪些代码行是不同的.
Any setting in properties, can be set in code, in fact, it probably IS set in code that''s generated by the IDE. So, I would suggest looking at the auto generated code and seeing what it does, an easy way to do this is to copy your project, change that one thing in the IDE, then diff the two projects and find what line of code is different.


这篇关于如何动态删除编辑控件的边框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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