I have the following Structure
Public Structure Info_Diag_Data
Public DataOne As String
Public DataTwo As String
End Structure
And this function uses the above class
Public Shared Function My_Function(ByVal RcvVal As Integer) As Info_Diag_Data
Dim SendVal As Info_Diag_Data
Select Case RcvVal
Case 1
SendVal.DataOne = "Red"
SendVal.DataTwo = "Master"
Case 2
SendVal.DataOne = "Red"
SendVal.DataTwo = "Teacher"
End Select
Return SendVal
End Function
Now i know i can execute this function using My_Function(2)
My question is how to display this data after getting these two returned values from function.
Like as i got DataOne and DataTwo in return. Then how can i show it in MessageBox.Show(DataOne) and MessageBox.Show(DataTwo)
You’ll need to store the results in a
Info_Diag_Datavalue, then you’ll be able to access the various members of the object through that variable, like this: