{ Learn Code. Share Code. Teach Code. Love Code. }

  • If statement for the richTextBox1!

  • Post your questions regarding programming in C++ in here.
Post your questions regarding programming in C++ in here.
 #46976  by emreozpalamutcu
 Thu Jun 23, 2011 7:23 am
Hi,
I have this richTextBox1 and when users enter something there and click send email will come to me, then I question came to my had what if they send empty message, i don't get the message if it's empty but what should make them think that they are spamming me when their not. So my question is when the richTextBox1 is empty, no text is written then message box will say please enter your message. or a another message that makes more sense.

Thank you.
 #46978  by MrAksel
 Thu Jun 23, 2011 8:34 am
Code: Select all
If String.IsNullOrWhiteSpace(RichTextBox1.Text) Then
   'No text or only space
   MsgBox("Please enter a valid message")
Else
   'There is a valid message, send the mail
End If
Im sorry that this is in VB.Net, but i dont know a be*p about C++
 #46981  by emreozpalamutcu
 Thu Jun 23, 2011 8:55 am
Thank you but that didn't really help, I done VB before if i knew that would of worked i would of tried it, C# and C++ is similar, but visual basic is almost a different thing. But thanks for the help, it's enough to thought to help. Some people knows the answer they can't be bothered answering.
 #46982  by Snyper345
 Thu Jun 23, 2011 9:15 am
emreozpalamutcu wrote:Thank you but that didn't really help, I done VB before if i knew that would of worked i would of tried it, C# and C++ is similar, but visual basic is almost a different thing. But thanks for the help, it's enough to thought to help. Some people knows the answer they can't be bothered answering.
its not that people cant be bothered its that barely anyone on here knows C++ just wait a day and if you do not have a reply i would use google :P