Using a variable in an expression

  • Thread starter Thread starter Derek Martin
  • Start date Start date
D

Derek Martin

Dim what As String = InputBox("What property do you want to get?",
"Requested Property")
RichTextBox1.AppendText(PersonList.getpersonbyusername(usernametextbox.Text)
..{what.ToString}.ToString)

How can I do this???? (or is it not possible)

Thanks,
Derek
 
Derek Martin said:
Dim what As String = InputBox("What property do you want to get?",
"Requested Property")
RichTextBox1.AppendText(PersonList.getpersonbyusername(usernametextbox.Text)
.{what.ToString}.ToString)

How can I do this???? (or is it not possible)

A user shouldn't deal with property names, but if you need it:

http://msdn.microsoft.com/library/en-us/cpguide/html/cpcondynamicallyloadingusingtypes.asp


--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
I agree absolutely, this is more for testing purposes so that I can write
some code to pass into a generalized function that returns 'object
attribute' based on what is passed in.
:-)
Many thanks to you both!
 
Back
Top