c#


How do I check the contents of a TextBox?


I have a textbox. In that textbox I write Human. Then I click a button, and if the word is human, then on a richtextbox, the word human will appear.
Here's the code I've tried.
private void button3_Click(object sender, EventArgs e)
{
if (textBox4.Text)
{
richTextBox1.Text = "human";
}
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
string value = textBox4.Text;
}
I tried making the textbox into a string so I could use it in the if statement, but it didn't work, so instead I used texbox4.text, but it is still wrong.
You could simply do with this piece of code,
private void button1_Click(object sender, EventArgs e)
{
if(textBox1.Text =="human")
{
richTextBox1.Text = textBox1.Text;
}
}

Related Links

C# Switch Statement Using Method [duplicate]
C# method is not returning object - method chaining
visual studio Preview for mac xamarin Storyboard can't be loaded
EventHandler vs. EventHandler<TEventArgs>
Grouping datagridview result by date and sum sales
WPF TabItem border isn't reflecting BorderThickness property
Fastest way of getting properties of ManagementObject
MS Bot builder IForm Invalid Type Exception:Has xxx Expect yyy
Table.compute() C# MIN, MAX and AVG
Post Build Event: Build Class Library and Copy Bin Folder Contents
Loading a Large Form in MVC
Encrypt/Decrypt String for Functions [duplicate]
How to set a different language to Bot Framework in Facebook Channel?
SQL display table in vertical
how to converter unreadable block of code in a class
Practical examples of when to use a ListPool or any pool of collections

Categories

HOME
internet-explorer
azure-documentdb
network-programming
pyspark
grpc
boxplot
overrides
confluence-rest-api
checkpoint
multipartform-data
pyodbc
olap
gcloud
wowza
urllib2
yui
openstack-horizon
owncloud
template10
ringcentral
novacode-docx
accordion
xna
android-wear-2.0
chartist.js
rancher
expressionengine
boosting
edsdk
lines
kubectl
webspeech-api
motherboard
mediastream
google-chrome-console
test-kitchen
amazon-rds-aurora
apiman
ocpjp
enet
photoshop-script
suitesparse
msiexec
glade
toggleclass
mavlink
papyrus
access-violation
instaparse
queuing
pyshark
trendline
oryx
apache2-module
jquery-draggable
personality-insights
syncano
properties-file
azure-mobile-app
dcg
data-quality-services
attiny
shunting-yard
mind-manager
apache-pivot
windows-search
pytz
django-tests
xps
class-library
node-mongodb-native
kernel-density
data-layers
mongoid4
nop
complete
aspnet-compiler
kademlia
panelgrid
correctness
systrace
bash4
wdm
file-processing
http-response-codes
activescaffold
p4.net
konsole
ihtmldocument2
ironpython-studio

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App