📄 form_4.vb
字号:
Imports System.Data.SqlClient
Public Class Form_4
Private _form As MyErp.S_Forms
Public Property Form() As MyErp.S_Forms
Get
Return _form
End Get
Set(ByVal value As MyErp.S_Forms)
_form = value
End Set
End Property
Private _CLabel As Point
Public Property CLabel() As Point
Get
Return _CLabel
End Get
Set(ByVal value As Point)
_CLabel = value
End Set
End Property
Private _CControl As Point
Public Property CControl() As Point
Get
Return _CControl
End Get
Set(ByVal value As Point)
_CControl = value
End Set
End Property
'Private _CurrentPoing As Point
'Public Property CurrentPoint() As Point
' Get
' Return _CurrentPoing
' End Get
' Set(ByVal value As Point)
' _CurrentPoing = value
' End Set
'End Property
Sub New(ByVal toolItem As S_ToolItem)
Me.Form = S.SForms.Item(toolItem.FormID)
' 此调用是 Windows 窗体设计器所必需的。
InitializeComponent()
' 在 InitializeComponent() 调用之后添加任何初始化。
With Me
.Width = Form.Width
.Height = Form.Height
.Text = toolItem.Text
End With
Me.Form = Form
End Sub
Sub Fill_Component()
'CurrentPoint = Me.PointToClient(get
For Each comp As S_Component In SComponent.Values
If comp.FormID = Form.FormID Then
Dim lb As New Label
lb.Text = comp.Text
lb.Name = comp.Name
lb.Location = CLabel
CLabel = New Point(CLabel.X, CLabel.Y + lb.Height + 10)
Me.Panel_F4.Controls.Add(lb)
Select Case comp.ContID
Case 2
Dim txtBox As New TextBox
txtBox.Name = comp.Name
txtBox.Height = comp.Height
txtBox.Width = comp.Width
txtBox.Width = comp.Width
txtBox.Location = New Point(CControl.X, lb.Location.Y - 4)
CControl = New Point(CControl.X, CControl.Y + lb.Height + 10)
Me.Panel_F4.Controls.Add(txtBox)
Case 5
Dim cb As New CheckBox
cb.Name = comp.Name
cb.Text = comp.Text
cb.Location = New Point(CControl.X, lb.Location.Y - 4)
CControl = New Point(CControl.X, CControl.Y + lb.Height + 10)
Me.Panel_F4.Controls.Add(cb)
End Select
End If
Next
Me.Refresh()
End Sub
Private Sub Form_4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
CLabel = New Point(10, ToolStripF4.Height + 15)
CControl = New Point(CLabel.X + 100, CLabel.Y)
Fill_Component()
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -