Generic SortedList question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • active

    #1

    Generic SortedList question

    This is where a different thread ended.
    The subject of this query is quite different from that of the other thread
    so I thought I should start a new thread.

    I'm using
    Private mItemList As SortedList(Of String, StringWithInteg er)

    To populate a generic CombBox

    StringWithInteg er has two properties Str and Value

    I need to get the Value property of the StringWithInteg er part of the
    selected item

    The selected item should have the same type as the SortedList items (I
    guess)

    I got this far
    = DirectCast(Comb oBox1.SelectedI tem, SortedList(Of String,
    StringWithInteg er)).Value


    I don't think I want to cast to SortedList but something like
    SortedList.Item

    I noted the term KeyValuePair(of String, StringWithInteg er)
    but don't know how to use it

    Thanks for any help


  • RobinS

    #2
    Re: Generic SortedList question

    I posted an answer in the previous thread.

    Robin S.
    -----------------------
    " active" <activeNOSPAM @a-znet.comwrote in message
    news:uQOiU4QVHH A.4964@TK2MSFTN GP06.phx.gbl...
    This is where a different thread ended.
    The subject of this query is quite different from that of the other
    thread so I thought I should start a new thread.
    >
    I'm using
    Private mItemList As SortedList(Of String, StringWithInteg er)
    >
    To populate a generic CombBox
    >
    StringWithInteg er has two properties Str and Value
    >
    I need to get the Value property of the StringWithInteg er part of the
    selected item
    >
    The selected item should have the same type as the SortedList items (I
    guess)
    >
    I got this far
    = DirectCast(Comb oBox1.SelectedI tem, SortedList(Of String,
    StringWithInteg er)).Value
    >
    >
    I don't think I want to cast to SortedList but something like
    SortedList.Item
    >
    I noted the term KeyValuePair(of String, StringWithInteg er)
    but don't know how to use it
    >
    Thanks for any help
    >
    >

    Comment

    • active

      #3
      Re: Generic SortedList question

      I figured this was really a different subject
      Thanks


      "RobinS" <RobinS@NoSpam. yah.nonewrote in message
      news:gb-dnWewtthS4UbYnZ 2dnUVZ_qCmnZ2d@ comcast.com...
      >I posted an answer in the previous thread.
      >
      Robin S.
      -----------------------
      " active" <activeNOSPAM @a-znet.comwrote in message
      news:uQOiU4QVHH A.4964@TK2MSFTN GP06.phx.gbl...
      >This is where a different thread ended.
      >The subject of this query is quite different from that of the other
      >thread so I thought I should start a new thread.
      >>
      >I'm using
      >Private mItemList As SortedList(Of String, StringWithInteg er)
      >>
      >To populate a generic CombBox
      >>
      >StringWithInte ger has two properties Str and Value
      >>
      >I need to get the Value property of the StringWithInteg er part of the
      >selected item
      >>
      >The selected item should have the same type as the SortedList items (I
      >guess)
      >>
      >I got this far
      >= DirectCast(Comb oBox1.SelectedI tem, SortedList(Of String,
      >StringWithInte ger)).Value
      >>
      >>
      >I don't think I want to cast to SortedList but something like
      >SortedList.Ite m
      >>
      >I noted the term KeyValuePair(of String, StringWithInteg er)
      >but don't know how to use it
      >>
      >Thanks for any help
      >>
      >>
      >
      >

      Comment

      Working...