S
Smokey Grindle
Say I have a combo box with the following simple object
Public class MyObject
public ID as integer
public Name as string
public overrides sub ToString() as string
return name
end sub
end Class
now say I have a combo box that I add to the screen and add oh say 20 of
these objects to it (I don't want to data bind in this instance)... now say
I have the ID of 30, how would I tell the combo box to select the object
that has the ID of 30? I thought IEquatable and IComparable would do the job
since it would be a comparision... so implement a IComparable<t> and
IEquatable<t> with the type integer... to compare to the ID... but nothing
happened... so how would you do this? I just want to say say the selected
item = 30 and have the combo box select the correct item.. thanks!
Public class MyObject
public ID as integer
public Name as string
public overrides sub ToString() as string
return name
end sub
end Class
now say I have a combo box that I add to the screen and add oh say 20 of
these objects to it (I don't want to data bind in this instance)... now say
I have the ID of 30, how would I tell the combo box to select the object
that has the ID of 30? I thought IEquatable and IComparable would do the job
since it would be a comparision... so implement a IComparable<t> and
IEquatable<t> with the type integer... to compare to the ID... but nothing
happened... so how would you do this? I just want to say say the selected
item = 30 and have the combo box select the correct item.. thanks!