S
Supra
I have 8 panels control on right side uing treeview control. this will
work in vb6 but can't figuring in vb.net. and i got error
Sub PanelVisible(ByVal szPanel As String)
Dim i As Integer, VisiblePanel As New Panel
For i = 0 To 7
If TypeOf VisiblePanel.Controls(i) Is Panel Then
===> Additional information: Specified argument was out of the range of
valid values.
If VisiblePanel.Controls(i).Name = szPanel Then
VisiblePanel.Controls(i).Visible = True
VisiblePanel.Controls(i).Location = New
Point(160, 8)
VisiblePanel.Controls(i).Size = New Size(304, 256)
Else
VisiblePanel.Controls(i).Visible = False
End If
End If
Next
End Sub
Private Sub trvPreference_AfterSelect(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles
trvPreference.AfterSelect
Dim i As String
i = e.Node.Text
Select Case i
Case "Connect"
Dim cConnect As String
cConnect = "Connect" 'Panel1.Name
PanelVisible(cConnect)
Case "User Info"
Dim cUser As String
cUser = "User Info" 'Panel2.Name
PanelVisible(cUser)
Case "Identd"
Dim cIdent As String
cIdent = "Ident" 'Panel3.Name
PanelVisible(cIdent)
Case "Firewall"
Dim cFireWall As String
cFireWall = "Firewalls" 'Panel4.Name
PanelVisible(cFireWall)
Case "DCC"
Dim cDCC As String
cDCC = "DCC" 'Panel5.Name
PanelVisible(cDCC)
Case "DNS"
Dim cDNS As String
cDNS = "DNS" 'Panel6.Name
PanelVisible(cDNS)
Case "Misc"
Dim cMisc As String
cMisc = Misc" 'Panel7.Name
PanelVisible(cMisc)
Case "Colours"
' Panel1.Visible = False
' Panel2.Visible = False
' Panel3.Visible = False
' Panel4.Visible = False
' Panel5.Visible = False
' Panel6.Visible = False
' Panel7.Visible = False
'With Panel8
' .Visible = True
'.Location = New Point(160, 8)
'.Size = New Size(304, 268)
'End With
Dim c As String
c = "Colours" 'Panel8.Name
PanelVisible(c)
End Select
End Sub
ne ideas u can help me?
regards
work in vb6 but can't figuring in vb.net. and i got error
Sub PanelVisible(ByVal szPanel As String)
Dim i As Integer, VisiblePanel As New Panel
For i = 0 To 7
If TypeOf VisiblePanel.Controls(i) Is Panel Then
===> Additional information: Specified argument was out of the range of
valid values.
If VisiblePanel.Controls(i).Name = szPanel Then
VisiblePanel.Controls(i).Visible = True
VisiblePanel.Controls(i).Location = New
Point(160, 8)
VisiblePanel.Controls(i).Size = New Size(304, 256)
Else
VisiblePanel.Controls(i).Visible = False
End If
End If
Next
End Sub
Private Sub trvPreference_AfterSelect(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles
trvPreference.AfterSelect
Dim i As String
i = e.Node.Text
Select Case i
Case "Connect"
Dim cConnect As String
cConnect = "Connect" 'Panel1.Name
PanelVisible(cConnect)
Case "User Info"
Dim cUser As String
cUser = "User Info" 'Panel2.Name
PanelVisible(cUser)
Case "Identd"
Dim cIdent As String
cIdent = "Ident" 'Panel3.Name
PanelVisible(cIdent)
Case "Firewall"
Dim cFireWall As String
cFireWall = "Firewalls" 'Panel4.Name
PanelVisible(cFireWall)
Case "DCC"
Dim cDCC As String
cDCC = "DCC" 'Panel5.Name
PanelVisible(cDCC)
Case "DNS"
Dim cDNS As String
cDNS = "DNS" 'Panel6.Name
PanelVisible(cDNS)
Case "Misc"
Dim cMisc As String
cMisc = Misc" 'Panel7.Name
PanelVisible(cMisc)
Case "Colours"
' Panel1.Visible = False
' Panel2.Visible = False
' Panel3.Visible = False
' Panel4.Visible = False
' Panel5.Visible = False
' Panel6.Visible = False
' Panel7.Visible = False
'With Panel8
' .Visible = True
'.Location = New Point(160, 8)
'.Size = New Size(304, 268)
'End With
Dim c As String
c = "Colours" 'Panel8.Name
PanelVisible(c)
End Select
End Sub
ne ideas u can help me?
regards