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!

Dialog Pop-up box/window?

Status
Not open for further replies.

redGSRguy

Programmer
Sep 16, 2005
12
US
Another question for you gurus here. I want to have a pop up box that depends on the user's input into an edit box. So for example the box is suppose to take in a hex number of length 4.

If they enter a valid 0000-FFFF number no popup will occur.

If the number is too short I want to have a modal box pop-up saying you input is too short, then when they click ok clear that text box and SetFocus back to that box.

If the number is not valid a similar msg in a box appears and tells the user to try again.

Can someone direct me on the path of the correct popup box to use? I have looked at the Dialog box, am I on the correct path. Is there a way to vary the msg in the box or would I need to make two different dialog boxes to deal with this? Any help would be much appreciated.
 
Look at MessageBox in your help files.

Code:
Application->MessageBox("What the &*%$#*& are you doing? Your input is not correct.", "Invalid input", MB_OK);

This example will create a Window with the title "Invalid input" and the "What the ..." message with a button labeled "OK". Your program will pause and wait for input from the message box.

There are several options for the MessageBox. For example, you can ask Yes or No then do something based upon which button the user selects.

James P. Cottingham
-----------------------------------------
I'm number 1,229!
I'm number 1,229!
 
-after you use the MessageBox you need to clear the original (wrong) text and set the focus back on the edit box for new input:

TextBox1->Text = ""; // sets it to 'nothing'
TextBox1->SetFocus(); // waits for input at the box (again)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top