开发者

Showing Data (as Object) in a TextBox?

开发者 https://www.devze.com 2023-03-26 03:18 出处:网络
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 d

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

精彩评论

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