我正在尝试调整无边框表单的大小,但是当我使用右侧/底部增加大小时,边框和旧客户区域之间存在间隙,该间隙取决于移动鼠标的速度。
当您从左边框甚至从左下角调整大小时,效果会更加明显,到处都很可怕(我尝试使用其他商业应用程序,它也会发生)。当我更改为相当大的边框时也会发生这种效果,但它并不像删除表单边框时那么糟糕
表单布局由一个执行标题栏功能的顶部面板(带有一些图像和按钮)和一些显示其他信息的其他面板(如备忘录、其他控件等)组成。
我的代码有一个片段,我捕获鼠标按钮并向窗口发送消息,但我也尝试手动执行此操作,得到类似的结果
激活顶部面板的双缓冲区可以避免闪烁,但调整面板大小与调整表单大小不同步,从而出现间隙或部分面板消失
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;
我怎样才能避免该区域和/或强制重新绘制窗口?我正在使用 Delphi,但通用解决方案(或其他语言)甚至前进的方向对我来说都很好
先感谢您