怎么用vb.net2003模仿做一个资源管理器

zhuzhu_qiu 2008-06-14 04:40:46
怎么用vb.net2003模仿做一个资源管理器...把代码发过来
也可以发到邮箱里:502478733@qq.com
采用立刻给分...
...全文
205 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
tangweikai 2008-06-17
  • 打赏
  • 举报
回复
' Copyright (c) Microsoft Corporation. All rights reserved.
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class ExplorerStyleViewer
Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub

'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer

'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.exitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.SplitContainer1 = New System.Windows.Forms.SplitContainer
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip
Me.fileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.SplitContainer1.SuspendLayout()
Me.MenuStrip1.SuspendLayout()
Me.SuspendLayout()
'
'exitToolStripMenuItem
'
Me.exitToolStripMenuItem.Name = "exitToolStripMenuItem"
Me.exitToolStripMenuItem.Text = "E&xit"
'
'SplitContainer1
'
Me.SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
Me.SplitContainer1.Location = New System.Drawing.Point(0, 24)
Me.SplitContainer1.Name = "SplitContainer1"
Me.SplitContainer1.Size = New System.Drawing.Size(688, 481)
Me.SplitContainer1.SplitterDistance = 230
Me.SplitContainer1.TabIndex = 10
'
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.fileToolStripMenuItem})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(688, 24)
Me.MenuStrip1.TabIndex = 9
Me.MenuStrip1.Text = "MenuStrip1"
'
'fileToolStripMenuItem
'
Me.fileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.exitToolStripMenuItem})
Me.fileToolStripMenuItem.Name = "fileToolStripMenuItem"
Me.fileToolStripMenuItem.Text = "&File"
'
'ExplorerStyleViewer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(688, 505)
Me.Controls.Add(Me.SplitContainer1)
Me.Controls.Add(Me.MenuStrip1)
Me.MainMenuStrip = Me.MenuStrip1
Me.Name = "ExplorerStyleViewer"
Me.Text = "ExplorerStyleViewer2"
Me.SplitContainer1.ResumeLayout(False)
Me.MenuStrip1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents exitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SplitContainer1 As System.Windows.Forms.SplitContainer
Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
Friend WithEvents fileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
End Class


' Copyright (c) Microsoft Corporation. All rights reserved.
Imports System.IO

Public Class ExplorerStyleViewer
' Declare variables to hold instances of each of the custom classes
Private dtvwDirectory As DirectoryTreeView
Private flvFiles As FileListView
Private mivChecked As MenuItemView

' Handles the AfterSelect event for the DirectoryTreeView, which causes the
' FileListView object to display the contents of the selected directory.
Sub DirectoryTreeViewOnAfterSelect(ByVal obj As Object, ByVal tvea As TreeViewEventArgs)
flvFiles.ShowFiles(tvea.Node.FullPath)
End Sub

' This subroutine handles the Form Load event.
Private Sub ExplorerStyleViewer_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
' Create a flvFilesView instance.
flvFiles = New FileListView()
SplitContainer1.Panel2.Controls.Add(flvFiles)
flvFiles.Dock = DockStyle.Fill

' Create a DirectoryTreeView instance and add an OnAfterSelect event handler.
dtvwDirectory = New DirectoryTreeView()
'dtvwDirectory.Parent = Me
SplitContainer1.Panel1.Controls.Add(dtvwDirectory)
dtvwDirectory.Dock = DockStyle.Left
' Dynamically add an AfterSelect event handler.
AddHandler dtvwDirectory.AfterSelect, _
AddressOf DirectoryTreeViewOnAfterSelect

' Add a View menu command to the existing main menu.
Dim menuView As New ToolStripMenuItem("&View")
MenuStrip1.Items.Add(menuView)

' Add four menu items to the new View menu. Start by creating arrays to set
' properties of each menu item.
Dim astrView As String() = {"Lar&ge Icons", "S&mall Icons", "&List", "&Details"}
Dim aview As View() = {View.LargeIcon, View.SmallIcon, View.List, View.Details}
' Create an event handler for the menu items.
Dim eh As New EventHandler(AddressOf MenuOnViewSelect)

Dim i As Integer
For i = 0 To 3
' Use a custom class MenuItemView, which extends MenuItem to support a
' View property.
Dim miv As New MenuItemView()
miv.Text = astrView(i)
miv.View = aview(i)
miv.Checked = False
' Associate the handler created earlier with the Click event.
AddHandler miv.Click, eh

' Set the Default view to Details.
If i = 3 Then
mivChecked = miv
mivChecked.Checked = True
flvFiles.View = mivChecked.View
End If
' Add the new menu item to the View menu.
menuView.DropDownItems.Add(miv)
Next i
End Sub

' Handles the OnViewSelect event for the View menu items.
Sub MenuOnViewSelect(ByVal obj As Object, ByVal ea As EventArgs)
' Uncheck the currently checked item.
mivChecked.Checked = False
' Cast the event sender and check it.
mivChecked = CType(obj, MenuItemView)
mivChecked.Checked = True
' Change how the files are viewed in the FileListView control.
flvFiles.View = mivChecked.View
End Sub

Private Sub exitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitToolStripMenuItem.Click
Me.Close()
End Sub

End Class
神之泪花 2008-06-17
  • 打赏
  • 举报
回复
Mark
panxuejian 2008-06-16
  • 打赏
  • 举报
回复
使用TreeView和ListView就可以了。

主要是掌握TreeView和ListView组件的应用,做出来应该不是很难。

楼主可以去网上找找,很多地
CloneCenter 2008-06-16
  • 打赏
  • 举报
回复
http://www.codeproject.com/KB/cpp/VbNetExpTree.aspx
http://dev.csdn.net/develop/article/24/24885.shtm
http://dev.csdn.net/develop/article/15/15949.shtm
CathySun118 2008-06-15
  • 打赏
  • 举报
回复
参考:
http://topic.csdn.net/t/20050223/13/3800509.html
cauhorse 2008-06-14
  • 打赏
  • 举报
回复
[1]银华强, Visual Basic.Net经典开发案例[M], 中国铁道出版社,2003.3
第五章 文件浏览器
与你说的东西类似,自已去翻吧。。

16,717

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧