我正在尝试调整无边界窗体的大小,但是当我使用右侧/底部增加大小时,我会在边框和旧客户区之间产生间隙,这取决于移动鼠标的速度。在德尔福的无边界窗体/窗口中平滑调整大小
当你从左边框甚至左下角调整大小时,效果更明显,它在任何地方都很糟糕(我尝试过使用其他商业应用程序,而且它也发生了)。当我更改为可调整的边框时,也会发生这种效果,但这并不像删除表单边框时那么糟糕。
表单布局包含执行标题栏功能(带有一些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