viewdata.vb
来自「本页只为图象处理爱好者交流之用, 未经本人同意, 请勿下载. 另,本书及所附」· VB 代码 · 共 104 行
VB
104 行
Public Class ViewData
Inherits System.Windows.Forms.Form
#Region " Windows 窗体设计器生成的代码 "
Public Sub New()
MyBase.New()
'该调用是 Windows 窗体设计器所必需的。
InitializeComponent()
'在 InitializeComponent() 调用之后添加任何初始化
End Sub
'窗体重写处置以清理组件列表。
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 btn_OK As System.Windows.Forms.Button
Friend WithEvents btn_Cancel As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.btn_OK = New System.Windows.Forms.Button()
Me.btn_Cancel = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'btn_OK
'
Me.btn_OK.DialogResult = System.Windows.Forms.DialogResult.OK
Me.btn_OK.Location = New System.Drawing.Point(248, 24)
Me.btn_OK.Name = "btn_OK"
Me.btn_OK.TabIndex = 0
Me.btn_OK.Text = "确 定"
'
'btn_Cancel
'
Me.btn_Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btn_Cancel.Location = New System.Drawing.Point(248, 72)
Me.btn_Cancel.Name = "btn_Cancel"
Me.btn_Cancel.Size = New System.Drawing.Size(72, 24)
Me.btn_Cancel.TabIndex = 1
Me.btn_Cancel.Text = "取 消"
'
'ViewData
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(336, 277)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btn_Cancel, Me.btn_OK})
Me.Name = "ViewData"
Me.Text = "ViewData"
Me.ResumeLayout(False)
End Sub
#End Region
Function AddControl() As Boolean
Dim i As Integer
Dim DataText As TextBox
Dim DataLabel As Label
FieldNum = MyRS.Fields.Count
For i = 0 To FieldNum - 1 Step 1
DataText = New TextBox()
With DataText
.Left = 120
.Top = i * 30 + 21
.Height = 21
.Width = 100
.Visible = True
.Text = MyRS.Fields(i).Value.ToString
.Name = "Txt_" + MyRS.Fields(i).Name
End With
Me.Controls.Add(DataText)
DataLabel = New Label()
With DataLabel
.Left = 20
.Top = i * 30 + 21
.AutoSize = True
.Visible = True
.Text = MyRS.Fields(i).Name
.Name = "Lbl_" + MyRS.Fields(i).Name
End With
Me.Controls.Add(DataLabel)
Next
End Function
Private Sub ViewData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
AddControl()
End Sub
End Class
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?