Question help on type cast

Rachita

New member
Joined
Sep 20, 2008
Messages
4
Programming Experience
Beginner
Hi can anyone help me in this regard.

i want to know how to type cast to user defined type in vb.net.I have a mark object which contains student id , subject name,subject id and mark. I have to read the subject id from a combo box and read corresponding mark value from it to a text box.

Thank you
 
Please post in the most appropriate forum. VS.NET is for IDE issues, not language issues. Moved.

How exactly are your getting the data into the ComboBox in the first place? Are you binding a collection of Mark objects? If so you would cast the SelectedItem like so:
VB.NET:
Dim m As Mark = DirectCast(myComboBox.SelectedItem, Mark)
 
Back
Top