Showing Data (as Object) in a TextBox?
The code I use:
Dim enc As New System.Text.UTF8Encoding()
TextBox.Text = enc.GetString(datas)
datas's type is Object, and its value comes from开发者_如何学Python a .dll file that contains some data, such as "The web page address is www......"
But that code doesn't show all the data in the textbox, only the first letter (T) appears. What do I do?
Override the object's ToString method and pass that.
TextBox.Text = object.tostring.
The easiest thing to do is just make a
Partial Class ObjectClass
Public Overrides Function ToString() As String
Return Me.WhateverPropOrFieldYouWantToReturn
End Function
End Class
I hope this answer iscorrect AND helps = true :):)
精彩评论