Redimensionar o FORM
Bem pessoal a dúvida é simples como faço para não deixar o usuario redimensionar o form....?
[]´s
junior
[]´s
junior
Junior#
Curtidas 0
Respostas
Cristiano Flores
27/04/2003
Caro Junior,
Mude a propriedade do Form BorderStyle para bsSingle e se não quizer que o usuário maximize ou minimize o Form va a propriedade BorderIcons...
Mude a propriedade do Form BorderStyle para bsSingle e se não quizer que o usuário maximize ou minimize o Form va a propriedade BorderIcons...
GOSTEI 0
Rebel_inside
27/04/2003
o que você pode fazer também é definir as propriedades Constraints (MinWidth, MaxWidth, MinHeight, MaxHeight) para os valores que você quer que fique. Por exemplo:
Form1.Width:= 400;
Form1.Height:= 300;
Form1.Constraints.MaxWidth:= 400;
Form1.Constraints.MinWidth:= 400;
Form1.Constrains.MaxHeight:= 300;
Form1.Constraints.MinHeight:= 300;
ou também vc pode fazer o seguinte:
no evento OnConstrainedResize, defina a variável CanResize para False
procedure TForm1.ConstrainedResize(Sender: TObject, NewWidth, NewHeight: Integer; var CanResize: Boolean);
begin
CanResize:= False;
end;
e pronto!
Form1.Width:= 400;
Form1.Height:= 300;
Form1.Constraints.MaxWidth:= 400;
Form1.Constraints.MinWidth:= 400;
Form1.Constrains.MaxHeight:= 300;
Form1.Constraints.MinHeight:= 300;
ou também vc pode fazer o seguinte:
no evento OnConstrainedResize, defina a variável CanResize para False
procedure TForm1.ConstrainedResize(Sender: TObject, NewWidth, NewHeight: Integer; var CanResize: Boolean);
begin
CanResize:= False;
end;
e pronto!
GOSTEI 0
Aroldo Zanela
27/04/2003
Colega,
Para versão 7, mude a propriedade Align para alCustom e para versões anteriores, use a informação técnica abaixo:
[list:e4f91dda6a]
community.borland.com
Article #28186: How can one prevent a TForm from being moved or resized?
QUESTION:
How can one disable a TForm from being moved or resized?
ANSWER:
Place the following code in the FormCreate event:
procedure TForm1.FormCreate(Sender: TObject);
var
hMenuHandle : HMENU;
begin
hMenuHandle := GetSystemMenu(Form1.Handle, FALSE); //Get the handle of the Form
if (hMenuHandle <> 0) then
DeleteMenu(hMenuHandle, SC_MOVE, MF_BYCOMMAND); //disable moving
DeleteMenu(hMenuHandle, SC_SIZE, MF_BYCOMMAND); //disable resizing
end;
If you also want to prevent the user from minimizing and maximazing the form, in the Object Inspector, select the form you are concerned with and under the BorderIcons, set the biMinimize and biMaximize properties to False.
Last Modified: 02-JAN-02
[/list:u:e4f91dda6a]
Para versão 7, mude a propriedade Align para alCustom e para versões anteriores, use a informação técnica abaixo:
[list:e4f91dda6a]
community.borland.com
Article #28186: How can one prevent a TForm from being moved or resized?
QUESTION:
How can one disable a TForm from being moved or resized?
ANSWER:
Place the following code in the FormCreate event:
procedure TForm1.FormCreate(Sender: TObject);
var
hMenuHandle : HMENU;
begin
hMenuHandle := GetSystemMenu(Form1.Handle, FALSE); //Get the handle of the Form
if (hMenuHandle <> 0) then
DeleteMenu(hMenuHandle, SC_MOVE, MF_BYCOMMAND); //disable moving
DeleteMenu(hMenuHandle, SC_SIZE, MF_BYCOMMAND); //disable resizing
end;
If you also want to prevent the user from minimizing and maximazing the form, in the Object Inspector, select the form you are concerned with and under the BorderIcons, set the biMinimize and biMaximize properties to False.
Last Modified: 02-JAN-02
[/list:u:e4f91dda6a]
GOSTEI 0