A string is a string, regardless of you downcasting it to an object or not. You can check this with typeof temp is String
(typeof-keyword).
I don't understand where your actual problem is.
You cannot set a Label's Text property with a given object because Label.Text must be of Type String. But you could use Object's ToString to get a String represantation of your Object or if you know(check with typeof) that your Object is of type String you can simply cast it back:
Label1.Text = DirectCast(temp , String)
EDIT:
According to your updates, i strongly recommend to set Option Strict!
Why don't you simply assign the value to the Text property?
Label1.Text = "Test"
You're ByRef approach is very error-prone and not very readable.
If you really need such thing and you only want to set the Text property of different controls, try this:
Public Sub setControlText(ByVal ctrl As Control, ByVal text String)
ctrl.Text = text
End Sub
or if your "text" must be of type Object:
Public Sub setControlText(ByVal ctrl As Control, ByVal value As Object)
If Not value Is Nothing Then ctrl.Text = value.ToString
End Sub
or you can use reflection to set every property, but that should not be standard
Public Sub setProperty(ByVal obj As Object, ByVal propName As String, ByVal newValue As Object)
Dim prop As Reflection.PropertyInfo = obj.GetType().GetProperty(propName)
If Not prop Is Nothing AndAlso prop.CanWrite Then
prop.SetValue(obj, newValue, Nothing)
End If
End Sub
You can call this function in the following way(consider that the property-name is case sensitive):
setProperty(Label1, "Text", "Hello World!")