I can (sorta) comprehend what the VB code is trying to do, yes.
Vertekal
Posts
-
MessageBox with a timer? -
MessageBox with a timer?That's what I'm looking at, based on http://www.codeproject.com/KB/cs/A_Custom_Message_Box.aspx[^] I'm just trying to determine the best way to use it for my specific needs. Thanks!
-
MessageBox with a timer?I did search a bit first, but the first few answers were in VB or C++. I was hoping for C# examples. I did look further on the results and came across http://www.codeproject.com/KB/cs/A_Custom_Message_Box.aspx[^] which might be helpful. Thanks!
-
MessageBox with a timer?How would I add a timer to this? To keep things simple, I have a form with 1 button and 1 textbox. I have a messagebox that pops up when the textbox loses focus ... if the user clicks OK, it does something. However, if the user doesn't click OK within 3 seconds, I need the box to close and do something else. This is for a mobile app using .NETCF 3.5. Here's what I have so far in regards to the messagebox:
private void TextBox1_LostFocus(object sender, EventArgs e) { DialogResult result = MessageBox.show("message text","title",MessageBoxButtons.OK,MessageBoxIcon.None,MessageBoxDefaultButton.Button1): if (result == DialogResult.OK) { Button1.Focus(); } else { //Close messagebox and do some other things if 3 seconds have elapsed and OK was not clicked } }
Any help would be appreciated! Thanks! -
Checking several textboxes to make sure none are blank?I'll give this a shot .. looks interesting I'd do databinding, but not sure how. I'm still new at this. If I created the DB within Visual Studio I'd be able to do it, but it's created at runtime (SQL CE) EDIT: I just tried it, and it worked great. Thanks!!!
modified on Friday, April 4, 2008 1:36 PM
-
Checking several textboxes to make sure none are blank?I'm hoping there's a more streamlined approach to this. In a form, I have 7 textboxes and a button. When the button is clicked, each textbox needs to be looked at to ensure it contains something. If the textbox is blank, I have a label on the forum to alert the user of such. Then I direct focus to the blank textbox. So far I've been doing it like this:
if (txt1.text == "") { ErrorLabel.text = "Enter something in txt1"; txt1.focus(); } else if (txt2.text == "") { ErrorLabel.text = "Enter something in txt2"; txt2.focus(); } else if (txt3.text == "") { ErrorLabel.text = "Enter something in txt3"; txt3.focus(); } else if (... and so on, and so on for all 7 textboxes)
Is there a way to do it with less code?