Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Start Up Window over main form

Status
Not open for further replies.

Wings

Programmer
Feb 14, 2002
247
US
Hi,
I have a main form. When the program begins though, I need another form to show modally over the main form as soon as the program starts. I then need the user to make a selection on the new form and then it will close, once again displaying the main form. Does any one know how I do this?

Thanks
 
Your best bet is to use MessageBox.
Code:
int __fastcall MessageBox(const char * Text, const char * Caption, int Flags);
Text = text of message.
Caption = Caption of message box
Flags are
MB_ABORTRETRYIGNORE The message box contains three push buttons: Abort, Retry, and Ignore.
MB_OK The message box contains one push button: OK. This is the default.
MB_OKCANCEL The message box contains two push buttons: OK and Cancel.
MB_RETRYCANCEL The message box contains two push buttons: Retry and Cancel.
MB_YESNO The message box contains two push buttons: Yes and No.
MB_YESNOCANCEL The message box contains three push buttons: Yes, No, and Cancel.

The message returns:
Code:
VALUE    NUMERIC_VALUE  MEANING
         0              Not enough memory to display the box.
IDOK     1              The user chose the OK button.
IDCANCEL 2              The user chose the Cancel button.
IDABORT  3              The user chose the Abort button.
IDRETRY  4              The user chose the Retry button.
IDIGNORE 5              The user chose the Ignore button.
IDYES    6              The user chose the Yes button.
IDNO     7              The user chose the No button.
NOTE: This is for BCB but the Windows API is similar.

Code:
Application->MessageBox("Warning! You are about to enter the Twilight Zone!","Danger", MB_OK);
will create a box that will display the warning message with a caption of "Danger" and an OK button. There are also message dialogs, too. James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
do:

Form2->ShowModal();

that will make it seem like a MessageDlg to the program, bringing it above your main form. You could also just make form2 your main form...

Cyprus
[noevil]
 
Thanks for the advice, the problem is though, the user has to make a selection from a list of radio buttons. then press the ok, the main program relies on the choice entered in that form.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top