This is a Example for Override ToString Method in VB.Net
Public Class Class1
Public idx As Integer
Public Overrides Function ToString() As String
Return Me.idx.ToString() + " " + "VB.Net"
End Function
End Class
Paste this following code in your main form Public idx As Integer
Public Overrides Function ToString() As String
Return Me.idx.ToString() + " " + "VB.Net"
End Function
End Class
Dim cl As Class1 = New Class1
cl.idx = 100
MessageBox.Show(cl.ToString())
Result:cl.idx = 100
MessageBox.Show(cl.ToString())
100 VB.Net