Click here to Skip to main content
15,905,508 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi, I would like to know, how to compare an image name with text in textbox? I paint some image named "test" for example in picturebox and if I write to textbox "test" it compared it and do something... Thx for answer. :)
Posted
Comments
Sergey Alexandrovich Kryukov 21-Feb-15 13:51pm    
How about using ==? :-)
—SA
Member 10808387 21-Feb-15 14:17pm    
But == cannot be used with System.Drawing.Image and string...

1 solution

Comparing a string to the contents of a TextBox is just
C#
if (textbox.Text == "test")
{
    // true
}
else
{
    // not true
}
 
Share this answer
 
Comments
Member 10808387 21-Feb-15 15:18pm    
It cannot be textbox.Text == "test"... is something like pictureBox1.Image.ToString() or Tag == textbox.Text.
Richard MacCutchan 22-Feb-15 3:19am    
If you know the answer why did you post the question?
Member 10808387 22-Feb-15 5:37am    
Because string and Tag doesn't work.
Richard MacCutchan 22-Feb-15 7:39am    
What does "doesn't work" mean?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900