⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 frmread.vb

📁 <Visual Basic 数据库开发实例精粹(第二版)>一书首先介绍了Visual Basic(简称VB)开发的技巧和重点技术
💻 VB
字号:
Public Class frmRead
  Inherits System.Windows.Forms.Form

  Dim m_dmMsg As New InfoProSysBusiness.MessageDataModel

  Public Property MessageInfo() As InfoProSysBusiness.MessageDataModel
    Get
      Return m_dmMsg
    End Get
    Set(ByVal Value As InfoProSysBusiness.MessageDataModel)
      m_dmMsg = Value
    End Set
  End Property

#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 窗体设计器所必需的
  '可以使用 Windows 窗体设计器修改此过程。
  '不要使用代码编辑器修改它。
  Friend WithEvents rtxtContent As System.Windows.Forms.RichTextBox
  Public WithEvents palPrevTitle As System.Windows.Forms.Panel
  Public WithEvents labPrevTitle As System.Windows.Forms.Label
  Public WithEvents Label2 As System.Windows.Forms.Label
  Friend WithEvents labProcLimitTime As System.Windows.Forms.Label
  Friend WithEvents labSendTime As System.Windows.Forms.Label
  Friend WithEvents labAddresserTel As System.Windows.Forms.Label
  Friend WithEvents labAddresser As System.Windows.Forms.Label
  Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
  Friend WithEvents lnkAddresser As System.Windows.Forms.LinkLabel
  Friend WithEvents MainMenu1 As System.Windows.Forms.MainMenu
  Friend WithEvents MenuItem1 As System.Windows.Forms.MenuItem
  Friend WithEvents mItemExit As System.Windows.Forms.MenuItem
  Friend WithEvents lnkSendTime As System.Windows.Forms.LinkLabel
  Friend WithEvents lnkAddresserTel As System.Windows.Forms.LinkLabel
  Friend WithEvents lnkTimeLimited As System.Windows.Forms.LinkLabel
  Friend WithEvents mItemReply As System.Windows.Forms.MenuItem
  Friend WithEvents MenuItem2 As System.Windows.Forms.MenuItem
  Friend WithEvents btnExit As System.Windows.Forms.Button
  <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
    Me.rtxtContent = New System.Windows.Forms.RichTextBox
    Me.palPrevTitle = New System.Windows.Forms.Panel
    Me.labPrevTitle = New System.Windows.Forms.Label
    Me.Label2 = New System.Windows.Forms.Label
    Me.labProcLimitTime = New System.Windows.Forms.Label
    Me.labSendTime = New System.Windows.Forms.Label
    Me.labAddresserTel = New System.Windows.Forms.Label
    Me.labAddresser = New System.Windows.Forms.Label
    Me.GroupBox1 = New System.Windows.Forms.GroupBox
    Me.btnExit = New System.Windows.Forms.Button
    Me.lnkTimeLimited = New System.Windows.Forms.LinkLabel
    Me.lnkAddresserTel = New System.Windows.Forms.LinkLabel
    Me.lnkSendTime = New System.Windows.Forms.LinkLabel
    Me.lnkAddresser = New System.Windows.Forms.LinkLabel
    Me.MainMenu1 = New System.Windows.Forms.MainMenu
    Me.MenuItem1 = New System.Windows.Forms.MenuItem
    Me.mItemReply = New System.Windows.Forms.MenuItem
    Me.MenuItem2 = New System.Windows.Forms.MenuItem
    Me.mItemExit = New System.Windows.Forms.MenuItem
    Me.palPrevTitle.SuspendLayout()
    Me.GroupBox1.SuspendLayout()
    Me.SuspendLayout()
    '
    'rtxtContent
    '
    Me.rtxtContent.AutoWordSelection = True
    Me.rtxtContent.Cursor = System.Windows.Forms.Cursors.Default
    Me.rtxtContent.Dock = System.Windows.Forms.DockStyle.Fill
    Me.rtxtContent.Location = New System.Drawing.Point(0, 88)
    Me.rtxtContent.Name = "rtxtContent"
    Me.rtxtContent.ReadOnly = True
    Me.rtxtContent.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical
    Me.rtxtContent.Size = New System.Drawing.Size(607, 301)
    Me.rtxtContent.TabIndex = 41
    Me.rtxtContent.Text = "this is the content"
    '
    'palPrevTitle
    '
    Me.palPrevTitle.BackColor = System.Drawing.Color.FromArgb(CType(128, Byte), CType(128, Byte), CType(128, Byte))
    Me.palPrevTitle.Controls.Add(Me.labPrevTitle)
    Me.palPrevTitle.Controls.Add(Me.Label2)
    Me.palPrevTitle.Cursor = System.Windows.Forms.Cursors.Default
    Me.palPrevTitle.Dock = System.Windows.Forms.DockStyle.Top
    Me.palPrevTitle.ForeColor = System.Drawing.SystemColors.WindowText
    Me.palPrevTitle.Location = New System.Drawing.Point(0, 66)
    Me.palPrevTitle.Name = "palPrevTitle"
    Me.palPrevTitle.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.palPrevTitle.Size = New System.Drawing.Size(607, 22)
    Me.palPrevTitle.TabIndex = 40
    Me.palPrevTitle.TabStop = True
    '
    'labPrevTitle
    '
    Me.labPrevTitle.AutoSize = True
    Me.labPrevTitle.BackColor = System.Drawing.Color.Transparent
    Me.labPrevTitle.Cursor = System.Windows.Forms.Cursors.Default
    Me.labPrevTitle.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.labPrevTitle.ForeColor = System.Drawing.Color.White
    Me.labPrevTitle.Location = New System.Drawing.Point(12, 4)
    Me.labPrevTitle.Name = "labPrevTitle"
    Me.labPrevTitle.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.labPrevTitle.Size = New System.Drawing.Size(77, 19)
    Me.labPrevTitle.TabIndex = 36
    Me.labPrevTitle.Text = "信件内容:"
    '
    'Label2
    '
    Me.Label2.AutoSize = True
    Me.Label2.BackColor = System.Drawing.Color.Transparent
    Me.Label2.Cursor = System.Windows.Forms.Cursors.Default
    Me.Label2.Font = New System.Drawing.Font("宋体", 10.5!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.Label2.ForeColor = System.Drawing.Color.Black
    Me.Label2.Location = New System.Drawing.Point(11, 5)
    Me.Label2.Name = "Label2"
    Me.Label2.RightToLeft = System.Windows.Forms.RightToLeft.No
    Me.Label2.Size = New System.Drawing.Size(77, 19)
    Me.Label2.TabIndex = 35
    Me.Label2.Text = "信件内容:"
    '
    'labProcLimitTime
    '
    Me.labProcLimitTime.AutoSize = True
    Me.labProcLimitTime.Location = New System.Drawing.Point(273, 35)
    Me.labProcLimitTime.Name = "labProcLimitTime"
    Me.labProcLimitTime.Size = New System.Drawing.Size(54, 17)
    Me.labProcLimitTime.TabIndex = 56
    Me.labProcLimitTime.Text = "处理时限"
    '
    'labSendTime
    '
    Me.labSendTime.AutoSize = True
    Me.labSendTime.Location = New System.Drawing.Point(24, 34)
    Me.labSendTime.Name = "labSendTime"
    Me.labSendTime.Size = New System.Drawing.Size(54, 17)
    Me.labSendTime.TabIndex = 55
    Me.labSendTime.Text = "发件时间"
    '
    'labAddresserTel
    '
    Me.labAddresserTel.AutoSize = True
    Me.labAddresserTel.Location = New System.Drawing.Point(273, 12)
    Me.labAddresserTel.Name = "labAddresserTel"
    Me.labAddresserTel.Size = New System.Drawing.Size(66, 17)
    Me.labAddresserTel.TabIndex = 54
    Me.labAddresserTel.Text = "发件人电话"
    '
    'labAddresser
    '
    Me.labAddresser.AutoSize = True
    Me.labAddresser.Location = New System.Drawing.Point(24, 12)
    Me.labAddresser.Name = "labAddresser"
    Me.labAddresser.Size = New System.Drawing.Size(42, 17)
    Me.labAddresser.TabIndex = 53
    Me.labAddresser.Text = "发件人"
    '
    'GroupBox1
    '
    Me.GroupBox1.Controls.Add(Me.btnExit)
    Me.GroupBox1.Controls.Add(Me.lnkTimeLimited)
    Me.GroupBox1.Controls.Add(Me.lnkAddresserTel)
    Me.GroupBox1.Controls.Add(Me.lnkSendTime)
    Me.GroupBox1.Controls.Add(Me.lnkAddresser)
    Me.GroupBox1.Controls.Add(Me.labAddresser)
    Me.GroupBox1.Controls.Add(Me.labSendTime)
    Me.GroupBox1.Controls.Add(Me.labAddresserTel)
    Me.GroupBox1.Controls.Add(Me.labProcLimitTime)
    Me.GroupBox1.Dock = System.Windows.Forms.DockStyle.Top
    Me.GroupBox1.Location = New System.Drawing.Point(0, 0)
    Me.GroupBox1.Name = "GroupBox1"
    Me.GroupBox1.Size = New System.Drawing.Size(607, 66)
    Me.GroupBox1.TabIndex = 57
    Me.GroupBox1.TabStop = False
    '
    'btnExit
    '
    Me.btnExit.DialogResult = System.Windows.Forms.DialogResult.Cancel
    Me.btnExit.FlatStyle = System.Windows.Forms.FlatStyle.Popup
    Me.btnExit.Location = New System.Drawing.Point(519, 17)
    Me.btnExit.Name = "btnExit"
    Me.btnExit.Size = New System.Drawing.Size(57, 38)
    Me.btnExit.TabIndex = 62
    Me.btnExit.Text = "Exit"
    '
    'lnkTimeLimited
    '
    Me.lnkTimeLimited.AutoSize = True
    Me.lnkTimeLimited.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.lnkTimeLimited.LinkColor = System.Drawing.Color.Black
    Me.lnkTimeLimited.Location = New System.Drawing.Point(348, 35)
    Me.lnkTimeLimited.Name = "lnkTimeLimited"
    Me.lnkTimeLimited.Size = New System.Drawing.Size(94, 17)
    Me.lnkTimeLimited.TabIndex = 61
    Me.lnkTimeLimited.TabStop = True
    Me.lnkTimeLimited.Text = "lnkTimeLimited"
    '
    'lnkAddresserTel
    '
    Me.lnkAddresserTel.AutoSize = True
    Me.lnkAddresserTel.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.lnkAddresserTel.LinkColor = System.Drawing.Color.Black
    Me.lnkAddresserTel.Location = New System.Drawing.Point(348, 12)
    Me.lnkAddresserTel.Name = "lnkAddresserTel"
    Me.lnkAddresserTel.Size = New System.Drawing.Size(101, 17)
    Me.lnkAddresserTel.TabIndex = 60
    Me.lnkAddresserTel.TabStop = True
    Me.lnkAddresserTel.Text = "lnkAddresserTel"
    '
    'lnkSendTime
    '
    Me.lnkSendTime.AutoSize = True
    Me.lnkSendTime.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.lnkSendTime.LinkColor = System.Drawing.Color.Black
    Me.lnkSendTime.Location = New System.Drawing.Point(98, 35)
    Me.lnkSendTime.Name = "lnkSendTime"
    Me.lnkSendTime.Size = New System.Drawing.Size(75, 17)
    Me.lnkSendTime.TabIndex = 59
    Me.lnkSendTime.TabStop = True
    Me.lnkSendTime.Text = "lnkSendTime"
    '
    'lnkAddresser
    '
    Me.lnkAddresser.AutoSize = True
    Me.lnkAddresser.Font = New System.Drawing.Font("宋体", 9.0!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
    Me.lnkAddresser.LinkColor = System.Drawing.Color.Black
    Me.lnkAddresser.Location = New System.Drawing.Point(98, 12)
    Me.lnkAddresser.Name = "lnkAddresser"
    Me.lnkAddresser.Size = New System.Drawing.Size(82, 17)
    Me.lnkAddresser.TabIndex = 58
    Me.lnkAddresser.TabStop = True
    Me.lnkAddresser.Text = "lnkAddresser"
    '
    'MainMenu1
    '
    Me.MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.MenuItem1})
    '
    'MenuItem1
    '
    Me.MenuItem1.Index = 0
    Me.MenuItem1.MenuItems.AddRange(New System.Windows.Forms.MenuItem() {Me.mItemReply, Me.MenuItem2, Me.mItemExit})
    Me.MenuItem1.Text = "文件"
    '
    'mItemReply
    '
    Me.mItemReply.Index = 0
    Me.mItemReply.Text = "回复(&R)"
    '
    'MenuItem2
    '
    Me.MenuItem2.Index = 1
    Me.MenuItem2.Text = "-"
    '
    'mItemExit
    '
    Me.mItemExit.Index = 2
    Me.mItemExit.Text = "退出(&X)"
    '
    'frmRead
    '
    Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
    Me.CancelButton = Me.btnExit
    Me.ClientSize = New System.Drawing.Size(607, 389)
    Me.Controls.Add(Me.rtxtContent)
    Me.Controls.Add(Me.palPrevTitle)
    Me.Controls.Add(Me.GroupBox1)
    Me.Menu = Me.MainMenu1
    Me.Name = "frmRead"
    Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
    Me.Text = "frmRead"
    Me.palPrevTitle.ResumeLayout(False)
    Me.GroupBox1.ResumeLayout(False)
    Me.ResumeLayout(False)

  End Sub

#End Region


  Private Sub frmRead_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '控件显示赋值
    With m_dmMsg
      lnkAddresser.Text = .m_szAddresserTrueName
      lnkAddresserTel.Text = .m_szAddresserTel
      lnkSendTime.Text = .m_dtSendTime
      lnkTimeLimited.Text = .m_dtProcTimeLimit
      Try
        rtxtContent.Rtf = .m_szInfoContent
      Catch ex As Exception
        rtxtContent.Text = .m_szInfoContent
      End Try
    End With
  End Sub

  Private Sub mItemReply_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mItemReply.Click
    Dim frmSendObj As New frmSendMsg

    frmSendObj.SetReplyDeptId(m_dmMsg.m_iDeptSendId)
    frmSendObj.SetReplyMsgId(m_dmMsg.m_iInfoID)
    frmSendObj.SetFormSendStatus(SendMsgStatus.Reply)
    frmSendObj.Show()

    Me.Close()

  End Sub

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

  Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
    Me.Close()

  End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -