Re: Possible ListView bug and ArgumentOutOfRangeException
From: Matt Burland (wjousts_at_[no)
Date: 07/22/04
- Next message: Jorge Aguilar: "Loading Windows User Control hosted in IE takes too long."
- Previous message: SD: "ListView Header draw problem"
- In reply to: Mike: "Possible ListView bug and ArgumentOutOfRangeException"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 16:42:51 -0500
You can wrap the problem statement with:
if (!this.DesignMode)
{
// problem statements
}
To prevent it from trying to do things during design that it can't do. The
problem is probably that the ListView at design time doesn't contain any
data and yet is trying to execute your ListView.Items(0).EnsureVisible (not
possible because Items(0) doesn't exist!).
"Mike" <mberger@skypoint.com> wrote in message
news:c3654e90.0407221244.7d959930@posting.google.com...
> I have a form with a ListView and a timer.
> The timer fires,
> sets Timer1.Enabled = False
> and fills up the ListView with data.
>
> While I'm filling up the ListView, at particular times, I do a
> ListView.Items(xxx).EnsureVisible - I do this to cause the ListView to
> scroll and give some activity to the UI. At the end of the routine, I
> do a
> ListView.Items(0).EnsureVisible
> to scroll back to the first entry.
>
> All that works, then I created another form and inherit from the
> previous form. Using the IDE (the development environment, not runtime
> !!!! ) I sporadically get a messagebox, with the
> ArgumentOutOfRangeException and complaining that the displayIndex of 0
> is illegal. If I comment out the ListView.Items(0).EnsureVisible line,
> the error seems to go away. Anyone have any ideas ? This is my first
> attempt at .net, so I may be all wet too ...
>
> Mike
- Next message: Jorge Aguilar: "Loading Windows User Control hosted in IE takes too long."
- Previous message: SD: "ListView Header draw problem"
- In reply to: Mike: "Possible ListView bug and ArgumentOutOfRangeException"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|