Very easy question...

Prevent user from resizing Form!
In D3 you selected Resizable bsNone but
in D5 ...where did it go?
Hate clicking so please a quick hint...
So in D5,how do you prevent user from resizing form?Ha...
SendoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

kretzschmarCommented:
hi sendo

adjust the constraints-property min and max of width and height to the same value

meikl
0
nricoCommented:
I'm convinced: D5 sux! :-) (kidding)
0
victor_christovCommented:
hi sendo

Try BorderStyle := bsSingle ;

Victor
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

nricoCommented:
In Delphi 4 it's "Borderstyle=bsSingle" instead of "bsResizable". I dunno if that is also the case in D5?
0
nricoCommented:
Hey Victor, you answered it when I was still typing!! :-)
0
samchanCommented:
{
IMHO, I believe the way I am doing it is much better although it takes a bit of work.
However, this way, I can have the form maximized properly whether there is or without
windows task bar. Besides, no problem will arise if users were to choose a different
screen resolution.
Hope this helps.

SA/\/\
}

type
  TfrmMain = class(TForm)
    { .....}
    procedure FormActivate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  Private
    done: Boolean;
    procedure WMWindowPosChanging(var Msg: TWMWindowPosChanging); Message WM_WindowPosChanging;
  Public
    { Public declarations }
  end;

{...}

implementation

procedure TfrmMain.FormActivate(Sender: TObject);
begin
  inherited;
  done := True;
end;

{ Window can be maximized the first time }
procedure TfrmMain.FormShow(Sender: TObject);
begin
  inherited;
  {...}
  WindowState := wsMaximized;
end;

{ This will prevent users from moving or resizing the desktop }
procedure TfrmMain.WMWindowPosChanging;
begin
  if done then
    Msg.WindowPos^.Flags := Msg.WindowPos^.Flags or SWP_NOMOVE or SWP_NOSIZE;
end;
0
isasoriCommented:
Try bsSingle (as Victor Says) and bsDialog
0
SendoAuthor Commented:
Too much typing for a trivial thing.
I would rather have the user suffer!
Ha,ha,ha....
I will try Meikls and Vics sugg...
Tell ya later...
0
florisbCommented:
Even more complete, but I should't get points for this, errrrh?

Use the help!

Oh help,
Floris

Specifies the appearance and behavior of the form border.

property BorderStyle: TFormBorderStyle;

Description

Use BorderStyle to get or set the appearance and behavior of the form border. BorderStyle can be any of the following TFormBorderStyle values:

Value      Meaning

bsDialog      Not resizeable; standard dialog box border
bsSingle      Not resizeable; single-line border
bsNone      Not resizeable; no visible border line
bsSizeable      Standard resizeable border
bsToolWindow      like bsSingle but with a smaller caption
bsSizeToolWin      like bsSizeable with a smaller caption

Note:      Changing the border style of an MDI child form to bsDialog or bsNone has no effect.
0
WMPetersCommented:
Okay, Sendo

You're right, easy question, so this one requires an easy answer: Two solutions.


#1

In Delhpi 5 (Enterprise):

In the Object Inspector, choose by the property BorderStyle for the option bsDialog. Now the user can not change the formsize anymore

#2

Install the LMD components, which came as a special edition for Delphi 5 and can be found on the same CD-Rom. Choose for the tab LMD SYS in the component table. Choose for the fourth element of this tab, being the element LMD-FORM. In the object inspector you can define more detailed properties for the form, also the max an min size of this form. Make those two value's the same, and you're there. TIP. When using non-visual compnents, you can make the form large while editing, once started, the form wil be reduced to the value's given bij the max and min items.

If you did not install these components yet, do so. They are exceptional good. You can also download a (unlimited) trial version at www.lmd.de

Success
0
WMPetersCommented:
By the way, forgot to add to the question (to fast to answer, sorry):

If you ad the line:
ShowWindow(Application.Handle,SW_HIDE);
then you also remove the button in the taskbar, and thereby another way to use Minimize and Maximize.

0
florisbCommented:
ShowWindow(application.handle, SW_HIDE);
ShowWindow(FindWindow(nil, @Application.Title[1]), SW_HIDE);

In the application.activate event. Hides it a bit more...
0
SendoAuthor Commented:
Sorry ...
"In the Object Inspector, choose by the property BorderStyle for the option bsDialog. Now the user can not change the formsize anymore "
This option prevents user from Max/Min the form and that is not what I want...
Using bsSingle does the trick...
so the points to Victor !
Meikl also had a good point....
Well I guess Vic answered it first (or no?)
Ok,Vic

0
SendoAuthor Commented:
Sorry ...
"In the Object Inspector, choose by the property BorderStyle for the option bsDialog. Now the user can not change the formsize anymore "
This option prevents user from Max/Min the form and that is not what I want...
Using bsSingle does the trick...
so the points to Victor !
Meikl also had a good point....
Well I guess Vic answered it first (or no?)
Ok,Vic

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.