Delphi 11 如何使當您將游標懸停在調整表單大小時,會出現一個帶有一些字樣的十字??,例如:“不要調整大小”并且無法調整表單大小?
當我呼叫第二個表單時,我需要阻止我的第一個表單調整大小。我是 Delphi 的新手,你能幫我嗎?
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form1.Caption:= 'Main';
Form1.BorderStyle:= bsSingle;
//And Form1.OnCanResize() or in some other way?
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Caption:= 'Main Form';
Form1.BorderStyle:= bsSizeable;
Form2.Hide;
end;
uj5u.com熱心網友回復:
問題解決了。
“如果你不喜歡這個答案,并不意味著它不對。但繼續洗掉我的評論:)”
當專業人士無法幫助您而只能表達傲慢時,這真是太可悲了。繼續,你真有趣)
procedure TForm1.Button1Click(Sender: TObject);
begin
Form2.Show;
Form1.Caption:= 'Main';
Form1.BorderStyle:= bsSingle;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Form1.Caption:= 'Main Form';
Form1.BorderStyle:= bsSizeable;
Form1.Cursor:= crDefault;
Form1.Hint:= '';
Form1.ShowHint:= False;
Form2.Hide;
end;
procedure TForm1.Timer1Timer(Sender: TObject); //Interval = 1
var
pt: TPoint;
Width, Heigth: Integer;
begin
GetCursorPos(pt);
if Form2.Visible then
begin
if (ScreenToClient(pt).X > ClientWidth - 10) or (ScreenToClient(pt).Y > ClientHeight - 10) then
begin
Cursor:= crNo;
Hint:= 'No resize';
ShowHint:= True;
end
else
begin
Cursor:= crDefault;
Hint:= '';
ShowHint:= False;
end;
end;
end;
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/377374.html
