Form fixo no mesmo lugar
Oi pessoal,
Existe alguma propriedade do form que impeça o mesmo de ser movido de lugar pelo usuário?
Obrigado!
Existe alguma propriedade do form que impeça o mesmo de ser movido de lugar pelo usuário?
Obrigado!
Yankleber
Curtidas 0
Respostas
Rocsadan
11/09/2003
- Na seção Private declare a procedure abaixo:
private
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
- Abaixo da palavra implementation escreva a procedure abaixo:
procedure TForm1.WMMove(var Msg: TWMMove);
begin
if Left < 0 then
Left := 0;
if Top < 0 then
Top := 0;
if Screen.Width - (Left + Width) < 0 then
Left := Screen.Width - Width;
if Screen.Height - (Top + Height) < 0 then
Top := Screen.Height - Height;
end;
Esta impede o arrasto, talves ajude.
private
procedure WMMove(var Msg: TWMMove); message WM_MOVE;
- Abaixo da palavra implementation escreva a procedure abaixo:
procedure TForm1.WMMove(var Msg: TWMMove);
begin
if Left < 0 then
Left := 0;
if Top < 0 then
Top := 0;
if Screen.Width - (Left + Width) < 0 then
Left := Screen.Width - Width;
if Screen.Height - (Top + Height) < 0 then
Top := Screen.Height - Height;
end;
Esta impede o arrasto, talves ajude.
GOSTEI 0