If statement for the richTextBox1!
Post your questions regarding programming in C++ in here.
6 posts
Page 1 of 1
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.
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.
Code: Select all
Im sorry that this is in VB.Net, but i dont know a be*p about C++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
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
![Image]()
![Image]()
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!

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.
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
lol I almost done it, I had a idea and it's kind of working just having trouble with end if and I will search that on Google 

Code: Select all
This is was the code I needed. if (richTextBox1->Text=="")
{
MessageBox::Show("Please enter your message!", "empty", MessageBoxButtons::OK, MessageBoxIcon::Exclamation);
}
else
{
//second action here
}
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023