我正在嘗試調整無邊界窗體的大小,但是當我使用右側/底部增加大小時,我會在邊框和舊客戶區之間產生間隙,這取決於移動鼠標的速度。在德爾福的無邊界窗體/窗口中平滑調整大小
當你從左邊框甚至左下角調整大小時,效果更明顯,它在任何地方都很糟糕(我嘗試過使用其他商業應用程序,而且它也發生了)。當我更改爲可調整的邊框時,也會發生這種效果,但這並不像刪除表單邊框時那麼糟糕。
表單佈局包含執行標題欄功能(帶有一些tImages和按鈕)的頂部面板,以及一些顯示其他信息的其他面板(如備忘錄,其他控件等)
有一段我的代碼,我捕獲鼠標按鈕併發送消息到Windows,但我也嘗試用類似的結果手動執行
激活頂部面板的雙緩衝區可避免閃爍,但調整面板的大小不會與窗體大小調整同步,從而出現間隙或部分面板消失
procedure TOutputForm.ApplicationEvents1Message(var Msg: tagMSG;
var Handled: Boolean);
const
BorderBuffer = 5;
var
X, Y: Integer;
ClientPoint: TPoint;
direction: integer;
begin
Handled := false;
case Msg.message of
WM_LBUTTONDOWN:
begin
if fResizable then
begin
if fSides = [sTop] then
direction := 3
else if fSides = [sLeft] then
direction := 1
else if fSides = [sBottom] then
direction := 6
else if fSides = [sRight] then
direction := 2
else if fSides = [sRight, sTop] then
direction := 5
else if fSides = [sLeft, sTop] then
direction := 4
else if fSides = [sLeft, sBottom] then
direction := 7
else if fSides = [sRight, sBottom] then
direction := 8;
ReleaseCapture;
SendMessage(Handle, WM_SYSCOMMAND, (61440 + direction), 0);
Handled := true;
end;
end;
WM_MOUSEMOVE:
begin
// Checks the borders and sets fResizable to true if it's in a "border"
// ...
end; // mousemove
end; // case
end;
我該如何避免該區域和/或強制窗口被重繪?我使用德爾福而是一個通用的解決方案(或其他語言),甚至一個方向往前走就可以了,我
預先感謝您
你的意思是有調整大小期間「缺口」,一旦結束調整操作形式是畫好不好? – ain
如何調整無邊界格式? – NGLN
但更重要的是:你畫自己嗎?你使用OnPaint事件處理程序嗎?如果都是這樣:也許這幅畫太重了,或者這幅畫可以做得更聰明嗎?請向我們展示您的代碼設計,然後我們可以幫助您更好。 – NGLN