ok I am pulling the source from a website and putting it into a textbox. I want to make it so that if the word "Troll" is anywhere in the textbox then something happens.
how would I do this? thanks
how would I do this? thanks
|
C#
If textbox has a word then this happens |
|
Nov 22, 2014 08:20 PM
(This post was last modified: Nov 22, 2014 08:20 PM by Aristocles.)
If TextBox1.Text.Contains("Troll") Then
'do things here End If
Assert failure(PID 10704 [0x000029d0], Thread: 10960 [0x2ad0]): pBuffer != NULL
(Nov 22, 2014 08:20 PM)Aristocles Wrote: If TextBox1.Text.Contains("Troll") Then This is in the C# section, not the VB section. Also format your code with the [code] tags :) (Nov 22, 2014 08:22 PM)Jack_Soff Wrote: Fuck i tried that but had it setup wrong thats why it wasnt working, thanks so much No problem, have a nice night! 😁 (Nov 23, 2014 04:58 AM)Dialog Wrote: This would be the better option being that it recognizes all casing and doesn't allow for words other than exactly "troll". (Nov 22, 2014 08:19 PM)Programming Wrote: Smarter (Removes case sensitivity): Code if (textBox1.Text.ToLower().Contains("troll")) {I post my opinions, please try not to be offended... I am not saying I am superior, but my interpretation of what you are saying may be befuddling.
ok, maybe someone on this thread can help me, im making a small program which is just a textbox takes commands theres a pic https://i.gyazo.com/0057fa3c88aabf40da62...97aa5f.png and i want it to spit out an error when you type in something thats not a command, this is pretty much how i tryed to do it but it splits out the error as soon as you type something in, is there anyone for it to wait a few secounds?
if (TextBox1.Text.Contains("function")) { // function } if (TextBox1.Text.Contains("function1")) { // function1 } else { MessegeBox.Show("this isnt a command"); }
Dec 6, 2014 08:09 AM
(This post was last modified: Dec 6, 2014 08:09 AM by Fafaffy.)
PHP Code (Dec 6, 2014 08:09 AM)Fafaffy Wrote:that would be used to code multiple commands onto one function, yes? i have coded a different function for each command and want it to tell me when im typing something that isnt a command, sorry if this doesnt make sense or is stupid to you, im new to this, thanks for replying. (Dec 6, 2014 10:16 AM)Astek Wrote: that would be used to code multiple commands onto one function, yes? "You just dun goofed" 😏😏 |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [.NET] by Moon RockJul 22, 2016 07:53 AM | 2 | 218 |
Jul 22, 2016 07:53 AM Last Post: Moon Rock |
| [.NET] by ShadyShadowApr 26, 2014 06:30 PM | 9 | 236 |
Apr 26, 2014 06:30 PM Last Post: 0xDEAD10CC |
| [C] by monkey2008Oct 15, 2013 09:02 AM | 4 | 115 |
Oct 15, 2013 09:02 AM Last Post: pratap95 |