开发者

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 :):)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜