Delphi 窗口没有边框的方法
2013-08-27 15:11
597 查看
只需在form子窗体中create中写入以下代码,就可以了。
setwindowlong(handle,GWL_STYLE,getwindowlong(handle,GWL_STYLE)and not ws_caption);
clientheight:=height;
refresh;
以上代码我实验过,完全可行。
当然你还可以改变子窗体的其他选项,如下:
1、使窗体没有边框
在form的create事件中
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Border);
clientheight:=height;
refresh;
2、使窗体没有系统菜单
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Sysmenu);
clientheight:=height;
refresh;
3、使窗体最大值无效
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Maximizebox);
clientheight:=height;
refresh;
4、使窗体最小值无效
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Minimizebox);
clientheight:=height;
refresh;
5、使窗体没有标题
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Caption);
clientheight:=height;
refresh;
是不是有了变化,不过其中有些功能可以从form的属性中进行设置,也可以实现此类效果。
setwindowlong(handle,GWL_STYLE,getwindowlong(handle,GWL_STYLE)and not ws_caption);
clientheight:=height;
refresh;
以上代码我实验过,完全可行。
当然你还可以改变子窗体的其他选项,如下:
1、使窗体没有边框
在form的create事件中
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Border);
clientheight:=height;
refresh;
2、使窗体没有系统菜单
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Sysmenu);
clientheight:=height;
refresh;
3、使窗体最大值无效
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Maximizebox);
clientheight:=height;
refresh;
4、使窗体最小值无效
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Minimizebox);
clientheight:=height;
refresh;
5、使窗体没有标题
var
windowstyle:longint;
windowstyle:=getwindowlong(handle,GWL_Style);
setwindowlong(handle,GWL_Style,windowstyle and not WS_Caption);
clientheight:=height;
refresh;
是不是有了变化,不过其中有些功能可以从form的属性中进行设置,也可以实现此类效果。
相关文章推荐
- Delphi中拖动无边框窗口的5种方法
- Delphi中拖动无边框窗口的5种方法
- Delphi中拖动无边框窗口的5种方法
- Delphi中拖动无边框窗口的5种方法
- Delphi中拖动无边框窗口的几种简单方法
- [转]IE点击链接没有反应或打开新窗口出现一个空白框(地址栏空白)的解决方法
- Delphi中让窗口关闭按钮无效的6种方法
- 百度编辑器ueditor插入表格没有边框颜色的解决方法
- qt/X11使窗口没有边框并且不在任务栏里显示
- c#中两种方法拖动没有边框的窗体
- presentViewController显示方式的窗口,没有导航栏的解决方法
- 最好的移动无边框窗口的方法
- 一个最简单的Delphi2010的PNG异形窗口方法
- vs2003属性窗口空白(什么都没有)的解决方法
- presentViewController显示方式的窗口,没有导航栏的解决方法
- Delphi中创建一个可以改变大小的无边框窗口
- Delphi中创建一个可以改变大小的无边框窗口
- Delphi 动态创建窗口的几种方法
- Delphi获取其它进程窗口句柄的3种方法
- Delphi中无边框窗体应用程序使任务栏右键菜单有效的方法