在运行时更改边框样式 [英] change border style at runtime
本文介绍了在运行时更改边框样式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在运行时更改文本框的边框样式.有谁能够帮助我.我只想通过在运行时单击按钮来启用和禁用边框.
Hi,
I want to change my textbox''s border style during runtime. Can anybody help me. I just want to enable and disable the border by clicking a button during runtime.
推荐答案
使用 ^ ]和 ^ ] ...
来自互联网:
删除一些样式 [
Use GetWindowLong[^] and SetWindowLong[^]...
From the Internet:
Removing some styles[^]:
LONG lStyle = GetWindowLong(hwnd, GWL_STYLE);
lStyle &= ~(WS_CAPTION | WS_THICKFRAME | WS_MINIMIZE | WS_MAXIMIZE | WS_SYSMENU);
SetWindowLong(hwnd, GWL_STYLE, lStyle);
删除扩展样式 [
Removing extended styles[^]:
LONG lExStyle = GetWindowLong(hwnd, GWL_EXSTYLE);
lExStyle &= ~(WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE);SetWindowLong(hwnd, GWL_EXSTYLE, lExStyle);
之后,您需要重新绘制窗口:
And after that you need to redraw the window:
SetWindowPos(hwnd, NULL, 0,0,0,0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOOWNERZORDER);
HTH ...
HTH...
这篇关于在运行时更改边框样式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文