Hi, i have three textboxs, system time is in texbox1 , "09:00:00" is in textbox2 and i want to two times Comparison in vb.net, textbox3=textbox2 - textbox2, is any solution?

You can compare the string value if you're trying to determine if they are identical:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If (String.Compare(TextBox1.Text, TextBox2.Text, True) = 0) Then
      'Same value
    End If
  End Sub

To do it like you're supposed to you could load the data in to a DateTime :

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Dim dt1 As DateTime, dt2 As DateTime
    If Not (DateTime.TryParse(TextBox1.Text, dt1)) Then
      MessageBox.Show("Invalid datetime in textedit1")
      Return
    End If
    If Not (DateTime.TryParse(TextBox2.Text, dt2)) Then
      MessageBox.Show("Invalid datetime in textedit1")
      Return
    End If
    If (dt1 = dt2) Then
      MessageBox.Show("Times are equal")
      'Times are equal
    End If
  End Sub
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.