svnno****@sourc*****
svnno****@sourc*****
2010年 11月 12日 (金) 20:23:40 JST
Revision: 1058 http://sourceforge.jp/projects/tween/svn/view?view=rev&revision=1058 Author: syo68k Date: 2010-11-12 20:23:40 +0900 (Fri, 12 Nov 2010) Log Message: ----------- ObjectDisposedExceptionが起きることがあったのを修正 Modified Paths: -------------- trunk/Tween/DetailsListView.vb -------------- next part -------------- Modified: trunk/Tween/DetailsListView.vb =================================================================== --- trunk/Tween/DetailsListView.vb 2010-11-12 10:25:37 UTC (rev 1057) +++ trunk/Tween/DetailsListView.vb 2010-11-12 11:23:40 UTC (rev 1058) @@ -56,16 +56,18 @@ If value = MyBase.VirtualListSize Then Exit Property If MyBase.VirtualListSize > 0 And value > 0 Then Dim topIndex As Integer = 0 - If MyBase.VirtualListSize < value Then - If Me.TopItem Is Nothing Then - topIndex = 0 + If Not Me.IsDisposed Then + If MyBase.VirtualListSize < value Then + If Me.TopItem Is Nothing Then + topIndex = 0 + Else + topIndex = Me.TopItem.Index + End If + topIndex = Math.Min(topIndex, Math.Abs(value - 1)) + Me.TopItem = Me.Items(topIndex) Else - topIndex = Me.TopItem.Index + Me.TopItem = Me.Items(0) End If - topIndex = Math.Min(topIndex, Math.Abs(value - 1)) - Me.TopItem = Me.Items(topIndex) - Else - Me.TopItem = Me.Items(0) End If End If MyBase.VirtualListSize = value