科技行者

行者学院 转型私董会 科技行者专题报道 网红大战科技行者

知识库

知识库 安全导航

至顶网软件频道基础软件VB.NET实现Windows进程管理器

VB.NET实现Windows进程管理器

  • 扫一扫
    分享文章到微信

  • 扫一扫
    关注官方公众号
    至顶头条

本文详细介绍了在Visual Basic .Net中实现类似Windows进程管理器的具体方法....

作者:马金虎 来源:yesky 2007年11月10日

关键字:

  • 评论
  • 分享微博
  • 分享邮件
8. 把Visual Studio .Net的当前窗口切换到Form1.vb的代码编辑窗口,并用下列代码替换Form1.vb中的InitializeComponent过程对应的代码,下列代码作用是初始化窗体中加入的组件:

Private Sub InitializeComponent ( )
Me.ListView1 = New System.Windows.Forms.ListView ( )
Me.ColumnHeader1 = New System.Windows.Forms.ColumnHeader ( )
Me.ColumnHeader2 = New System.Windows.Forms.ColumnHeader ( )
Me.ColumnHeader3 = New System.Windows.Forms.ColumnHeader ( )
Me.ColumnHeader4 = New System.Windows.Forms.ColumnHeader ( )
Me.ContextMenu1 = New System.Windows.Forms.ContextMenu ( )
Me.MenuItem1 = New System.Windows.Forms.MenuItem ( )
Me.StatusBar1 = New System.Windows.Forms.StatusBar ( )
Me.StatusBarPanel1 = New System.Windows.Forms.StatusBarPanel ( )
Me.Button1 = New System.Windows.Forms.Button ( )
CType ( Me.StatusBarPanel1 , System.ComponentModel.ISupportInitialize ) .BeginInit ( )
Me.SuspendLayout ( )
Me.ListView1.Columns.AddRange ( New System.Windows.Forms.ColumnHeader ( ) {Me.ColumnHeader1 , Me.ColumnHeader2 , Me.ColumnHeader3 , Me.ColumnHeader4} )
Me.ListView1.ContextMenu = Me.ContextMenu1
Me.ListView1.Dock = System.Windows.Forms.DockStyle.Top
Me.ListView1.FullRowSelect = True
Me.ListView1.Name = "ListView1"
Me.ListView1.Size = New System.Drawing.Size ( 406 , 286 )
Me.ListView1.TabIndex = 0
Me.ListView1.View = System.Windows.Forms.View.Details
Me.ColumnHeader1.Text = "映像名称"
Me.ColumnHeader1.Width = 101
Me.ColumnHeader2.Text = "PID"
Me.ColumnHeader2.Width = 80
Me.ColumnHeader3.Text = "CPU时间"
Me.ColumnHeader3.Width = 101
Me.ColumnHeader4.Text = "内存使用"
Me.ColumnHeader4.Width = 130
Me.ContextMenu1.MenuItems.AddRange ( New System.Windows.Forms.MenuItem ( ) {Me.MenuItem1} )
Me.MenuItem1.Index = 0
Me.MenuItem1.Text = "结束进程"
Me.StatusBar1.Location = New System.Drawing.Point ( 0 , 349 )
Me.StatusBar1.Name = "StatusBar1"
Me.StatusBar1.Panels.AddRange ( New System.Windows.Forms.StatusBarPanel ( ) {Me.StatusBarPanel1} )
Me.StatusBar1.ShowPanels = True
Me.StatusBar1.Size = New System.Drawing.Size ( 406 , 22 )
Me.StatusBar1.TabIndex = 1
Me.StatusBar1.Text = "StatusBar1"
Me.StatusBarPanel1.Width = 406
Me.Button1.Location = New System.Drawing.Point ( 285 , 298 )
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size ( 87 , 33 )
Me.Button1.TabIndex = 2
Me.Button1.Text = "结束进程"
Me.AutoScaleBaseSize = New System.Drawing.Size ( 6 , 14 )
Me.ClientSize = New System.Drawing.Size ( 406 , 371 )
Me.Controls.AddRange ( New System.Windows.Forms.Control ( ) {Me.Button1 , Me.StatusBar1 , Me.ListView1} )
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "Form1"
Me.Text = "VB.NET打造Windows进程管理器"
CType ( Me.StatusBarPanel1 , System.ComponentModel.ISupportInitialize ) .EndInit ( )
Me.ResumeLayout ( False )
End Sub

  至此【VB.NET打造Windows进程管理器】项目的界面设计和功能实现的准备工作就完成了,具体如图02所示:


图02:【VB.NET打造Windows进程管理器】项目的设计界面
    • 评论
    • 分享微博
    • 分享邮件
    邮件订阅

    如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。

    重磅专题
    往期文章
    最新文章