Weird

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

    Weird

    Hi All Pro,

    I try to delete item from the listbox control, but I am always got this
    error message after the item was removed from the list:

    " There is no row at position 0 "

    Here is how I do it:

    listbox1.Items. RemoveAt( listbox1.Select edIndex );

    listbox1.ClearS elected();



    Any help is greatly appreciated. Thanks you all in advance...



    Kate


  • Kevin Spencer

    #2
    Re: Weird

    If the ListBox is empty, there is no row at position 0. There is no row
    period.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Who is Mighty Abbott?
    A twin turret scalawag.

    "cql90" <cql90@yahoo.co m> wrote in message
    news:%23DCiwuBK GHA.532@TK2MSFT NGP15.phx.gbl.. .[color=blue]
    > Hi All Pro,
    >
    > I try to delete item from the listbox control, but I am always got this
    > error message after the item was removed from the list:
    >
    > " There is no row at position 0 "
    >
    > Here is how I do it:
    >
    > listbox1.Items. RemoveAt( listbox1.Select edIndex );
    >
    > listbox1.ClearS elected();
    >
    >
    >
    > Any help is greatly appreciated. Thanks you all in advance...
    >
    >
    >
    > Kate
    >
    >[/color]


    Comment

    • cql90

      #3
      Re: Weird

      Thanks you so much Kevin, I am very appreciated. Take care and have a nice
      day...


      "Kevin Spencer" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
      news:OtIZ$RCKGH A.528@TK2MSFTNG P12.phx.gbl...[color=blue]
      > If the ListBox is empty, there is no row at position 0. There is no row
      > period.
      >
      > --
      > HTH,
      >
      > Kevin Spencer
      > Microsoft MVP
      > .Net Developer
      > Who is Mighty Abbott?
      > A twin turret scalawag.
      >
      > "cql90" <cql90@yahoo.co m> wrote in message
      > news:%23DCiwuBK GHA.532@TK2MSFT NGP15.phx.gbl.. .[color=green]
      >> Hi All Pro,
      >>
      >> I try to delete item from the listbox control, but I am always got this
      >> error message after the item was removed from the list:
      >>
      >> " There is no row at position 0 "
      >>
      >> Here is how I do it:
      >>
      >> listbox1.Items. RemoveAt( listbox1.Select edIndex );
      >>
      >> listbox1.ClearS elected();
      >>
      >>
      >>
      >> Any help is greatly appreciated. Thanks you all in advance...
      >>
      >>
      >>
      >> Kate
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Kevin Spencer

        #4
        Re: Weird

        Make sure and check the count before you try to delete any rows.

        --
        HTH,

        Kevin Spencer
        Microsoft MVP
        ..Net Developer
        Who is Mighty Abbott?
        A twin turret scalawag.

        "cql90" <cql90@yahoo.co m> wrote in message
        news:e4SWf1CKGH A.1312@TK2MSFTN GP09.phx.gbl...[color=blue]
        > Thanks you so much Kevin, I am very appreciated. Take care and have a nice
        > day...
        >
        >
        > "Kevin Spencer" <kevin@DIESPAMM ERSDIEtakempis. com> wrote in message
        > news:OtIZ$RCKGH A.528@TK2MSFTNG P12.phx.gbl...[color=green]
        >> If the ListBox is empty, there is no row at position 0. There is no row
        >> period.
        >>
        >> --
        >> HTH,
        >>
        >> Kevin Spencer
        >> Microsoft MVP
        >> .Net Developer
        >> Who is Mighty Abbott?
        >> A twin turret scalawag.
        >>
        >> "cql90" <cql90@yahoo.co m> wrote in message
        >> news:%23DCiwuBK GHA.532@TK2MSFT NGP15.phx.gbl.. .[color=darkred]
        >>> Hi All Pro,
        >>>
        >>> I try to delete item from the listbox control, but I am always got this
        >>> error message after the item was removed from the list:
        >>>
        >>> " There is no row at position 0 "
        >>>
        >>> Here is how I do it:
        >>>
        >>> listbox1.Items. RemoveAt( listbox1.Select edIndex );
        >>>
        >>> listbox1.ClearS elected();
        >>>
        >>>
        >>>
        >>> Any help is greatly appreciated. Thanks you all in advance...
        >>>
        >>>
        >>>
        >>> Kate
        >>>
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...