Results 1 to 4 of 4

Thread: reselect case in combobox after loading file?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    48

    reselect case in combobox after loading file?

    I have a combobox that does something like this:

    Select Case Me.ComboBox1.SelectedIndex
    Case 0
    num(1) = 100
    Case 1
    num(1) = 200
    End Select

    I am saving/opening data using xmlwriter/xmlreader. So when I open up a saved xml file, I want to do something like this:

    If num(1) = 100 Then me.combobox1.selectedindex = case 0
    elseif num(1) = 200 Then me.combox1.selectedindex = case 1
    End if


    The whole point is that I want the combobox to reselect the case when I open the xml file. How do I do that?

  2. #2
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: reselect case in combobox after loading file?

    I may be a little lost, but in that second snippet; is that after you've read the xmlreader into your array?

    If it is, you pretty much have the code already.
    VB Code:
    1. If num(1) = 100 Then
    2.    me.combobox1.selectedindex = 0
    3. elseif num(1) = 200 Then
    4.    me.combobox1.selectedindex = 1
    5. End if

  3. #3

    Thread Starter
    Member
    Join Date
    Feb 2006
    Posts
    48

    Resolved: reselect case in combobox after loading file?

    oh man, that was stupid of me. Thanks!

  4. #4
    Banned
    Join Date
    Nov 2005
    Posts
    2,367

    Re: reselect case in combobox after loading file?

    No prob.

    Don't forget to resolve your thread.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width