B
Beebs
I'm using the code at the end of this post to display a scrollbar on a
form when the SIP is launched by the user. I'm using VS 2003 and
writing this in VB.NET. I keep getting the following error:
An unhandled exception of type 'System.ObjectDisposedException'
occurred in System.Windows.Forms.dll
on this line of code:
VScrollBar1.Visible = True (in the Sub SetupScrollBar function)
Can anyone tell me why this is possibly happening? The name of the
scrollbar is correct, so I know that isn't the problem.
CODE:
Sub SetupScrollBar()
If (G_SIP = True) Then 'Define the size of the scrollbar
VScrollBar1.Visible = True
VScrollBar1.Height = MINSCROLLSIZE 'Set size of scrollbar
VScrollBar1.Maximum = Panel1.Height - MINSCROLLSIZE 'The
maximum scroll value places bottom of frame at bottom of screen
Else
VScrollBar1.Visible = False 'Hide the scrollbar, SIP isn't
showing
VScrollBar1.Value = 0
'Place the panel at the very top boundaries of the form
Panel1.Left = 0
Panel1.Top = 0
End If
VScrollBar1.Minimum = 0 'Set minimum to zero
'Set our increments to be ratio of current maximums
VScrollBar1.SmallChange = VScrollBar1.Maximum / 100
VScrollBar1.LargeChange = VScrollBar1.Maximum / 10
End Sub
Private Sub VScrollBar1_ValueChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles VScrollBar1.ValueChanged
'On scroll bar change move the frame w/r to the form
Panel1.Left = 0
Panel1.Top = -VScrollBar1.Value
End Sub
Private Sub InputPanel1_EnabledChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
If InputPanel1.Enabled = True Then
G_SIP = True 'SIP is showing
Else
G_SIP = False 'SIP isn't showing
End If
SetupScrollBar()
End Sub
form when the SIP is launched by the user. I'm using VS 2003 and
writing this in VB.NET. I keep getting the following error:
An unhandled exception of type 'System.ObjectDisposedException'
occurred in System.Windows.Forms.dll
on this line of code:
VScrollBar1.Visible = True (in the Sub SetupScrollBar function)
Can anyone tell me why this is possibly happening? The name of the
scrollbar is correct, so I know that isn't the problem.
CODE:
Sub SetupScrollBar()
If (G_SIP = True) Then 'Define the size of the scrollbar
VScrollBar1.Visible = True
VScrollBar1.Height = MINSCROLLSIZE 'Set size of scrollbar
VScrollBar1.Maximum = Panel1.Height - MINSCROLLSIZE 'The
maximum scroll value places bottom of frame at bottom of screen
Else
VScrollBar1.Visible = False 'Hide the scrollbar, SIP isn't
showing
VScrollBar1.Value = 0
'Place the panel at the very top boundaries of the form
Panel1.Left = 0
Panel1.Top = 0
End If
VScrollBar1.Minimum = 0 'Set minimum to zero
'Set our increments to be ratio of current maximums
VScrollBar1.SmallChange = VScrollBar1.Maximum / 100
VScrollBar1.LargeChange = VScrollBar1.Maximum / 10
End Sub
Private Sub VScrollBar1_ValueChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles VScrollBar1.ValueChanged
'On scroll bar change move the frame w/r to the form
Panel1.Left = 0
Panel1.Top = -VScrollBar1.Value
End Sub
Private Sub InputPanel1_EnabledChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
If InputPanel1.Enabled = True Then
G_SIP = True 'SIP is showing
Else
G_SIP = False 'SIP isn't showing
End If
SetupScrollBar()
End Sub