-
June 14th, 2012, 02:36 PM
#1
If richtextbox is empty to display a msgbox
if i press for example button1, and i want it to have a statement,
button1.
if richtextbox 1 = "" then,
msgbox1. "you have no text".
how do you do this in c#?
I USE VISUAL C# 2010 EXPRESS!
Last edited by tambovskya; June 14th, 2012 at 02:49 PM.
-
June 14th, 2012, 02:37 PM
#2
Re: If richtextbox is empty to display a msgbox
also one more question, how would i code that, example,
if richtextbox 1 contains word "like",
then change that word to "whatever"
-
June 14th, 2012, 02:44 PM
#3
Re: If richtextbox is empty to display a msgbox
Also is it possible to do this?
for example,
if richtextbox1 contains word "because", then
change it to any of these words,
example,
example,
example,
and random selector.
-
June 19th, 2012, 12:36 PM
#4
Re: If richtextbox is empty to display a msgbox
I use this for a textbox, pretty sure it's close to the same as a rich text box.
Code:
if (String.IsNullOrEmpty(textbox.Text))
MessageBox.Show("No text detected, please enter something!");
else
{
//Whatever you want it to do after it's no longer empty.
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|