delphi-Making a Form un maximizable

Posted on 2003-02-27
Medium Priority
Last Modified: 2010-04-17
How can i make a form in delphi not maximizable or minimizable just like in VB where it's very simple.
I want a form that the user can only view and close it in the size i want.
Question by:kmkip

Expert Comment

ID: 8032961
yourform.borderstyle := bsDialog;

Accepted Solution

msa2003 earned 800 total points
ID: 8035181
You may do it at the design time by editing the following properties:

1. TForm.BorderIcons: biMaximize flag should be set to false.
2. TForm.BorderStyle should be set to bsDialog (this option will not display an icon in the top-left of the form) or bsSingle.

Some theory ;-)

In Win32 API there is a function CreateWindow described below (used MSDN C++ syntax, but it could be used in Delphi with the same param list):

HWND CreateWindow(

    LPCTSTR lpClassName,     // pointer to registered class name
    LPCTSTR lpWindowName,     // pointer to window name
    DWORD dwStyle,     // window style
    int x,     // horizontal position of window
    int y,     // vertical position of window
    int nWidth,     // window width
    int nHeight,     // window height
    HWND hWndParent,     // handle to parent or owner window
    HMENU hMenu,     // handle to menu or child-window identifier
    HANDLE hInstance,     // handle to application instance
    LPVOID lpParam      // pointer to window-creation data
Parameter dwStyle has flags which allows or disallows the window to display some of border icons. This function is called once in TForm.Create method, so you could not change border icons appearance at runtime.

Featured Post

Train for your Pen Testing Engineer Certification

Enroll today in this bundle of courses to gain experience in the logistics of pen testing, Linux fundamentals, vulnerability assessments, detecting live systems, and more! This series, valued at $3,000, is free for Premium members, Team Accounts, and Qualified Experts.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

In this post we will learn different types of Android Layout and some basics of an Android App.
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …
Screencast - Getting to Know the Pipeline

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question