•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 456,607 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,492 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 5189 | Replies: 23
![]() |
•
•
Join Date: Nov 2007
Posts: 44
Reputation:
Rep Power: 2
Solved Threads: 0
Hello DaniWeb. I'm new to this site and will just have to say some words before asking my question. I'm Loyen and I am 14 years old and lives in Sweden. I've just started on an upper secondary school about IT and there I'm going one class that's called "programming" there we're learning the basics in Pascal.
Now, I'm really interested in this, and just wanted to know, how do I do a basic popup window that just gives you a message? Can I make one that has no buttons just a clean window without any "minimazers, closers" and all?
Write it here.
Thank you all for your time and hopefully somebody knows how to do a basic popup window.
//Loyen
Now, I'm really interested in this, and just wanted to know, how do I do a basic popup window that just gives you a message? Can I make one that has no buttons just a clean window without any "minimazers, closers" and all?
Write it here.

Thank you all for your time and hopefully somebody knows how to do a basic popup window.
//Loyen
Last edited by Loyen : Nov 7th, 2007 at 12:28 pm.
•
•
Join Date: Nov 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
Loyen,
Are you using Delphi for this class?
If so, there are several ways to go about doing this, although I would suggest having at least an "OK" button for closing the pop-up window.
One approach, in Delphi, would be to use a MessageDlg.
A question for you to consider is, if you create a pop-up window
, how do you plan to close the window and exit the program?
Are you using Delphi for this class?
If so, there are several ways to go about doing this, although I would suggest having at least an "OK" button for closing the pop-up window.
One approach, in Delphi, would be to use a MessageDlg.
MessageDlg('Test with no buttons',mtInformation,[],0);A question for you to consider is, if you create a pop-up window
•
•
•
•
that has no buttons just a clean window without any "minimazers, closers" and all
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
•
•
Join Date: Oct 2007
Location: Cherry Hill, NJ
Posts: 1,878
Reputation:
Rep Power: 13
Solved Threads: 193
OK, FP is very compatible with Delphi.
Add the Dialogs unit to your uses clause. The procedure that fits your requirement best is the first in this list:
procedure ShowMessage( const msg: string );
function MessageDlg( const msg: string; dlgType: tMsgDlgType; buttons: tMsgDlgButtons; helpctx: longint ): word;
function MessageDlgPos( ... x, y: integer ): word; //same args as MessageDlg
function InputBox( const aCaption, aPrompt, aDefault: string ): string;
function InputQuery( const aCaption, aPrompt: string; var value: string ): boolean;
The ShowMessage function just displays your message with a little OK button.
The MessageDlg displays a message with the desired icon and buttons.
The InputBox and InputQuery functions get a string from the user. The latter returns false if the user canceled.
type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
type TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mnNoToAll, mbYesToAll, mbHelp);
return values for MessageDlg:
mrNone mrAbort mrYes mrOk mrRetry mrNo mrCancel mrIgnore mrAll
If none of those work for you, create a new form that does what you want and set its border style to bsDialog. Display the form using the ShowModal function. Close the form and return a value by setting its ModalResult.
Good luck.
Add the Dialogs unit to your uses clause. The procedure that fits your requirement best is the first in this list:
procedure ShowMessage( const msg: string );
function MessageDlg( const msg: string; dlgType: tMsgDlgType; buttons: tMsgDlgButtons; helpctx: longint ): word;
function MessageDlgPos( ... x, y: integer ): word; //same args as MessageDlg
function InputBox( const aCaption, aPrompt, aDefault: string ): string;
function InputQuery( const aCaption, aPrompt: string; var value: string ): boolean;
The ShowMessage function just displays your message with a little OK button.
The MessageDlg displays a message with the desired icon and buttons.
The InputBox and InputQuery functions get a string from the user. The latter returns false if the user canceled.
type TMsgDlgType = (mtWarning, mtError, mtInformation, mtConfirmation, mtCustom);
type TMsgDlgBtn = (mbYes, mbNo, mbOK, mbCancel, mbAbort, mbRetry, mbIgnore, mbAll, mnNoToAll, mbYesToAll, mbHelp);
return values for MessageDlg:
mrNone mrAbort mrYes mrOk mrRetry mrNo mrCancel mrIgnore mrAll
If none of those work for you, create a new form that does what you want and set its border style to bsDialog. Display the form using the ShowModal function. Close the form and return a value by setting its ModalResult.
Good luck.
Last edited by Duoas : Nov 7th, 2007 at 6:14 pm.
•
•
Join Date: Nov 2007
Posts: 15
Reputation:
Rep Power: 2
Solved Threads: 0
If you use the
<code>
function MessageDlg( const msg: string; dlgType: tMsgDlgType; buttons: tMsgDlgButtons; helpctx: longint ): word;
</code>
approach and you do NOT want any buttons (which is still a most curious concept), you would write something like:
<code>
MessageDlg('your message goes here', mtInformation,[],0);
</code>
wherever you want it in your project and then, when that line is executed, it will pop up the message box.
<code>
function MessageDlg( const msg: string; dlgType: tMsgDlgType; buttons: tMsgDlgButtons; helpctx: longint ): word;
</code>
approach and you do NOT want any buttons (which is still a most curious concept), you would write something like:
<code>
MessageDlg('your message goes here', mtInformation,[],0);
</code>
wherever you want it in your project and then, when that line is executed, it will pop up the message box.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Pascal and Delphi Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Popup window on button click (ASP.NET)
- Help with popup window (Visual Basic 4 / 5 / 6)
- how to pass the value in popup window (PHP)
- Please help me with my javascript popup window! (ASP.NET)
- Javascript Popup Window (JavaScript / DHTML / AJAX)
- Popup window (ASP.NET)
- Make An Asp Popup Window--help Me About This... (JavaScript / DHTML / AJAX)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: help file creation
- Next Thread: How would I find a system's IP address in Delphi?




Linear Mode