General discussion

Locked

Displaying data in Visual Basic

By dksj ·
I need to display variant type data values on the screen. The label and textbox control objects only allow text. What is the easiest method to display data values? Because I am still learning vb, detailed descriptions and code samples would be most helpful.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Displaying data in Visual Basic

by Michael2 In reply to Displaying data in Visual ...

mytextbox.text = CStr(yourvariant)

or
Dim newvariable as String
newvariable = CStr(yourvariant)
Then you can use newvariable anywhere a string is expected. ie.
mytextbox.text = newvariable
mylabel.text = newvariable&" add text to string"All conversion functions explained in on-line help. They are

CBool(expression) Return boolean
CByte(expression)Return Byte
CCur(expression) Return currencey
CDate(expression)Return date
CDbl(expression) Return double
CDec(expression) Return decimal
CInt(expression) Return integer
CLng(expression) Return Long
CSng(expression) Return Single
CVar(expression) Return variant
CStr(expression) Return string

Collapse -

Displaying data in Visual Basic

by dksj In reply to Displaying data in Visual ...

Thank you for your help. It turned out to be quite easy. I figured there was a function for conversion but was not sure what it was and unfortunately my vb books dont go into that much detail. Thanks again.

Collapse -

Displaying data in Visual Basic

by dksj In reply to Displaying data in Visual ...

This question was closed by the author

Back to Desktop Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums