Hello to all , is there any code that will make possible check if the user typed a word i want in order to show him something ?

something like , if the user types time , or tim or timing or the word time and transformated to show him up the time ..

Regards,
xVent

Recommended Answers

All 4 Replies

I think you are talking about IF Else statements.
May be this code will help you ...

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If TextBox1.Text = "time" Or TextBox1.Text = "tim" Or TextBox1.Text = "now" Then
            TextBox1.Text = TimeOfDay
        ElseIf TextBox1.Text = "name" Or TextBox1.Text = "nam" Then
            TextBox1.Text = "VB.Net"
        ElseIf TextBox1.Text = "Age" Or TextBox1.Text = "age" Then
            TextBox1.Text = "10"
        End If

    End Sub

You can use AND like or.It will make you to check 2 conditions at the same time , that means it will run only if that 2 conditions are satisfied.

Try it ...
Best of luck ...

Thanks for the code but this will check if i have the word time only in the textbox .. i want it to check if a word for example "timezor" is in the textbox to understand the world time for example .. and it will continue to the write If or Sub ...

Use contains:

Public Class frmComplete
  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    ProcessString(TextBox1.Text)
  End Sub

  Private Sub ProcessString(ByVal s As String)
    If (s.Contains("time")) Then

    End If
  End Sub
End Class

thanks , ill try it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.