【分层体系结构】分层体系结构(MVC)四

更新时间:2014-04-03    来源:WinForm    手机版     字体:

【www.bbyears.com--WinForm】

 
四、WinForm
WinForm 层主要完成与用户互动操作,以及传递参数等。代码相对简单,因为工作都在下面的基层实现了。
以处理用户登录的代码login.vb为例,给大家一个概要的印象。
login.vb代码如下:
Public Class login
      Inherits System.Windows.Forms.Form
      Protected user As business.login.UserLimits
#Region " Windows 窗体设计器生成的代码 "
      Public Sub New()
     MyBase.New()
     '该调用是 Windows 窗体设计器所必需的。
     InitializeComponent()
     '在 InitializeComponent() 调用之后添加任何初始化
      End Sub
      '窗体重写 dispose 以清理组件列表。
      Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
     If disposing Then
         If Not (components Is Nothing) Then
             components.Dispose()
         End If
     End If
     MyBase.Dispose(disposing)
      End Sub
      'Windows 窗体设计器所必需的
      Private components As System.ComponentModel.IContainer
      '注意: 以下过程是 Windows 窗体设计器所必需的

本文来源:http://www.bbyears.com/asp/5333.html