(VS2010) help??
#1

(if this is not the forum or thread plz remove this topic)

here is the stuff

-----------------------------

Hey!

im new to this and i really want to know how to get the things separated. i get the bug that if i got to a folder it shows the both Items

It looks like this:

(THE IMG IS TO BIG SO U NEED TO CLICK THIS TEXT)


plz help?

here is the code
Код:
Imports System.Diagnostics
Imports System.Windows.Forms

Public Class Servers

    Private Sub Explorer1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Set up the UI
        SetUpListViewColumns()
        LoadTree()
    End Sub

    Private Sub LoadTree()
        ' TODO: Add code to add items to the treeview

        Dim tvRoot As TreeNode
        Dim tvNode As TreeNode

        tvRoot = Me.TreeView.Nodes.Add("Servers")
        tvNode = tvRoot.Nodes.Add("Texten Chat [OFFICIAL CHAT]")
        tvNode = tvRoot.Nodes.Add("TreeItem2")
    End Sub

    Private Sub LoadListView()
        ' TODO: Add code to add items to the listview based on the selected item in the treeview

        Dim lvItem As ListViewItem
        ListView.Items.Clear()

        lvItem = ListView.Items.Add("90.224.231.42")
        lvItem.SubItems.AddRange(New String() {"Yes", "http://jonnys-bgs.ucoz.net/updater.html"})

    End Sub

    Private Sub SetUpListViewColumns()

        ' TODO: Add code to set up listview columns
        Dim lvColumnHeader As ColumnHeader

        ' Setting Column widths applies only to the current view, so this line
        '  explicitly sets the ListView to be showing the SmallIcon view
        '  before setting the column width
        SetView(View.SmallIcon)

        lvColumnHeader = ListView.Columns.Add("IP")
        ' Set the SmallIcon view column width large enough so that the items
        '  do not overlap
        ' Note that the second and third column do not appear in SmallIcon
        '  view, so there is no need to set those while in SmallIcon view
        lvColumnHeader.Width = 90

        ' Change the view to Details and set up the appropriate column
        '  widths for the Details view differently than SmallIcon view
        SetView(View.Details)

        ' The first column needs to be slightly larger in Details view than it
        '  was for SmallIcon view, and Column2 and Column3 need explicit sizes
        '  set for Details view
        lvColumnHeader.Width = 100

        lvColumnHeader = ListView.Columns.Add("Public")
        lvColumnHeader.Width = 70

        lvColumnHeader = ListView.Columns.Add("Website")
        lvColumnHeader.Width = 70

    End Sub

    Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        'Close this form
        Me.Close()
    End Sub

    Private Sub ToolBarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolBarToolStripMenuItem.Click
        'Toggle the visibility of the toolstrip and also the checked state of the associated menu item
        ToolBarToolStripMenuItem.Checked = Not ToolBarToolStripMenuItem.Checked
        ToolStrip.Visible = ToolBarToolStripMenuItem.Checked
    End Sub

    Private Sub StatusBarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles StatusBarToolStripMenuItem.Click
        'Toggle the visibility of the statusstrip and also the checked state of the associated menu item
        StatusBarToolStripMenuItem.Checked = Not StatusBarToolStripMenuItem.Checked
        StatusStrip.Visible = StatusBarToolStripMenuItem.Checked
    End Sub

    'Change whether or not the folders pane is visible
    Private Sub ToggleFoldersVisible()
        'First toggle the checked state of the associated menu item
        Folde*******tripMenuItem.Checked = Not Folde*******tripMenuItem.Checked

        'Change the Folders toolbar button to be in sync
        Folde*******tripButton.Checked = Folde*******tripMenuItem.Checked

        ' Collapse the Panel containing the TreeView.
        Me.SplitContainer.Panel1Collapsed = Not Folde*******tripMenuItem.Checked
    End Sub

    Private Sub Folde*******tripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Folde*******tripMenuItem.Click
        ToggleFoldersVisible()
    End Sub

    Private Sub Folde*******tripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Folde*******tripButton.Click
        ToggleFoldersVisible()
    End Sub

    Private Sub SetView(ByVal View As System.Windows.Forms.View)
        'Figure out which menu item should be checked
        Dim MenuItemToCheck As ToolStripMenuItem = Nothing
        Select Case View
            Case View.Details
                MenuItemToCheck = DetailsToolStripMenuItem
            Case View.LargeIcon
                MenuItemToCheck = LargeIconsToolStripMenuItem
            Case View.List
                MenuItemToCheck = ListToolStripMenuItem
            Case View.SmallIcon
                MenuItemToCheck = SmallIconsToolStripMenuItem
            Case View.Tile
                MenuItemToCheck = TileToolStripMenuItem
            Case Else
                Debug.Fail("Unexpected View")
                View = View.Details
                MenuItemToCheck = DetailsToolStripMenuItem
        End Select

        'Check the appropriate menu item and deselect all others under the Views menu
        For Each MenuItem As ToolStripMenuItem In ListViewToolStripButton.DropDownItems
            If MenuItem Is MenuItemToCheck Then
                MenuItem.Checked = True
            Else
                MenuItem.Checked = False
            End If
        Next

        'Finally, set the view requested
        ListView.View = View
    End Sub

    Private Sub ListToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListToolStripMenuItem.Click
        SetView(View.List)
    End Sub

    Private Sub DetailsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DetailsToolStripMenuItem.Click
        SetView(View.Details)
    End Sub

    Private Sub LargeIconsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LargeIconsToolStripMenuItem.Click
        SetView(View.LargeIcon)
    End Sub

    Private Sub SmallIconsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SmallIconsToolStripMenuItem.Click
        SetView(View.SmallIcon)
    End Sub

    Private Sub TileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TileToolStripMenuItem.Click
        SetView(View.Tile)
    End Sub

    Private Sub TreeView_AfterSelect(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView.AfterSelect
        ' TODO: Add code to change the listview contents based on the currently-selected node of the treeview
        LoadListView()
    End Sub



    Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub


End Class
Reply


Messages In This Thread
(VS2010) help?? - by jonnyboy - 21.01.2011, 19:49
Re: (VS2010) help?? - by Outcast - 22.01.2011, 00:17
Re: (VS2010) help?? - by jonnyboy - 22.01.2011, 10:37
Re: (VS2010) help?? - by jonnyboy - 22.01.2011, 10:39
Re: (VS2010) help?? - by Outcast - 22.01.2011, 10:52
Re: (VS2010) help?? - by jonnyboy - 22.01.2011, 11:07
Re: (VS2010) help?? - by Outcast - 22.01.2011, 12:18
Re: (VS2010) help?? - by jonnyboy - 22.01.2011, 15:48
Re: (VS2010) help?? - by Outcast - 22.01.2011, 15:56
Re: (VS2010) help?? - by jonnyboy - 22.01.2011, 16:21

Forum Jump:


Users browsing this thread: 1 Guest(s)