Delphi 窗口沒有邊框的方法

只需在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的屬性中進行設置,也可以實現此類效果。
發佈了74 篇原創文章 · 獲贊 2 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章