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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

764 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