📄 设置_基本信息位置设置.frm
字号:
Key = "mrlk"
EndProperty
BeginProperty ListImage12 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "设置_基本信息位置设置.frx":3BA2
Key = "xsxm"
EndProperty
BeginProperty ListImage13 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "设置_基本信息位置设置.frx":3F3C
Key = "ht"
EndProperty
BeginProperty ListImage14 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "设置_基本信息位置设置.frx":42D6
Key = "st"
EndProperty
BeginProperty ListImage15 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "设置_基本信息位置设置.frx":4670
Key = ""
EndProperty
BeginProperty ListImage16 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "设置_基本信息位置设置.frx":4A0A
Key = "ml"
EndProperty
EndProperty
End
End
End
Attribute VB_Name = "Dev_ItemPlaceInfoForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim tf As Boolean
Dim Move_Y As Integer
Dim Move_X As Integer
Dim VS_int As Integer
Dim Rows_int As Integer
Dim Ssql_str As String
Dim add_item As New ADODB.Recordset
Dim VsE_TF As Boolean
Private Sub Command1_Click() '选中项目类别
Dev_ItemDEVSort.Show 1
If Trim(Dev_ItemDEVSort.Combo1.Tag) <> "" Then
Command1.Tag = Dev_ItemDEVSort.Combo1.ItemData(Dev_ItemDEVSort.Combo1.ListIndex)
Text1.Text = Dev_ItemDEVSort.Combo1.Text
Form_Load
End If
End Sub
Private Sub Form_Load()
List
End Sub
Public Sub List() '向界面加载项目信息
On Error Resume Next
Dim B As Integer
VsE_TF = False
Pict.Top = 0: Pict.Left = 0: VS_E.Value = 0
VsE_TF = True
For B = 1 To Text_t.Count - 1
Unload Text_t(B)
Unload T_Label(B)
Next B
'-------------
Dim i As Integer
i = 1
VS_E.Max = 500: VS_int = 0
If Trim(Command1.Tag) = "" Then Exit Sub
Set add_item = Cw_DataEnvi.DataConnect.Execute("select * from dev_V_Itemlist where isid=" & Val(Command1.Tag) & " and YNShow='1' order by tab")
Rows_int = add_item.RecordCount
Do While Not add_item.EOF
Load T_Label(i)
Load Text_t(i)
T_Label(i).Left = Val(add_item!itemleft & "")
T_Label(i).Top = Val(add_item!itemtop & "")
T_Label(i).Tag = add_item!ItemCode
T_Label(i).Caption = add_item!ItemChineseName
Text_t(i).Left = T_Label(i).Left + T_Label(i).Width + 100
Text_t(i).Top = T_Label(i).Top - 50
Text_t(i).TabIndex = "" & add_item!Tab - 1
Text_t(i).Width = add_item!ItmeFieldLength * 105
Text_t(i).Visible = True
Text_t(i).Text = add_item!Tab
T_Label(i).Visible = True
i = i + 1
add_item.MoveNext
Loop
add_item.Close
End Sub
Private Sub SzToolbar_ButtonClick(ByVal Button As MSComctlLib.Button)
Select Case Button.Key
Case "Save"
YesNo_str = MsgBox("您是否保存当前格式?", vbYesNo + 32)
If YesNo_str = vbNo Then Exit Sub
Save
Case "SD"
SD_Text
Case "HD"
HD_Text
Case "sx"
List
Case "Item"
If Trim(Text1.Text) = "" Then Exit Sub
Dev_ItemSortAddItem.SortCode.Caption = Text1.Text
Dev_ItemSortAddItem.SortCode.Tag = Command1.Tag
Dev_ItemSortAddItem.Show 1
List
Case "bz"
Call F1bz
Case "Exit"
Unload Me
End Select
End Sub
Private Sub T_Label_MouseDown(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
tf = True
Move_Y = y
Move_X = x
label1.Top = T_Label(Index).Top + 200
label1.Left = T_Label(Index).Left + 200
Label2.Caption = "X=" & Text_t(Index).Left & ",Y=" & Text_t(Index).Top
label1.Visible = True
End Sub
Private Sub T_Label_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
If tf = True Then
If T_Label(Index).Top - (Move_Y - y) >= 0 Then
If T_Label(Index).Top - (Move_Y - y) <= 5000 + VS_E.Value * 8 - 200 Then
T_Label(Index).Top = T_Label(Index).Top - (Move_Y - y)
label1.Top = label1.Top - (Move_Y - y)
Text_t(Index).Top = T_Label(Index).Top - 50
End If
End If
'-------------------
If T_Label(Index).Left - (Move_X - x) >= 0 Then
T_Label(Index).Left = T_Label(Index).Left - (Move_X - x)
label1.Left = label1.Left - (Move_X - x)
Text_t(Index).Left = T_Label(Index).Left + T_Label(Index).Width + 100
End If
Label2.Caption = "X=" & Text_t(Index).Left & ",Y=" & Text_t(Index).Top
End If
End Sub
Private Sub T_Label_MouseUp(Index As Integer, Button As Integer, Shift As Integer, x As Single, y As Single)
tf = False
label1.Visible = False
End Sub
Private Sub Text_T_Change(Index As Integer)
If Text_t(Index).Text <> "" Then
Text_t(Index).Text = Int(Val(Text_t(Index).Text))
End If
End Sub
Private Sub Text_T_DblClick(Index As Integer)
If Text_t(Index).BackColor = &HFFFFFF Then
Text_t(Index).BackColor = &HF2FAEB
Else
Text_t(Index).BackColor = &HFFFFFF
End If
End Sub
Private Sub Text_T_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then
Else
KeyAscii = 0
End If
End Sub
Private Sub VS_E_Change() '滚动条
If VsE_TF = True Then
If VS_int < VS_E.Value Then
Pict.Top = Pict.Top - (VS_E.Value * 8 - VS_int)
Else
If VS_int <> VS_E.Value Then
Pict.Top = Pict.Top + (VS_int - VS_E.Value * 8)
End If
End If
VS_int = VS_E.Value * 8
End If
End Sub
Private Sub Save() '保存格式
On Error Resume Next
Dim i As Integer
Dim h As Integer
For i = 1 To Rows_int
If Val(Text_t(i).Text) > Rows_int Or Val(Text_t(i).Text) <= 0 Then
MsgBox "Tab数必须是1至" & Rows_int & "之间的连续数值", 48
Text_t(i).SetFocus
Exit Sub
End If
'--------------------
For h = i + 1 To Rows_int
If Text_t(i).Text = Text_t(h).Text Then
MsgBox "Tab数值不能重复!", 48
Text_t(h).SetFocus
Exit Sub
End If
Next
Next
For i = 1 To Rows_int
Ssql_str = "UPDATE dev_Itemsortlist SET ItemLeft=" & T_Label(i).Left & ",ItemTop=" & T_Label(i).Top _
& ",Tab=" & Text_t(i).Text & " where ItemCode='" & T_Label(i).Tag & "' and isid=" & Val(Command1.Tag)
Cw_DataEnvi.DataConnect.Execute Ssql_str
Next i
End Sub
Private Sub SD_Text() '竖对
Dim i As Integer: Dim y As Integer
y = 1
For y = 1 To Text_t.Count - 1
If Text_t(y).BackColor = &HF2FAEB Then
For i = 1 To Text_t.Count - 1
If Text_t(i).BackColor = &HF2FAEB Then
If Text_t(y).Top > Text_t(i).Top Then
y = i
End If
End If
Next i
Exit For
End If
Next y
For i = 1 To Text_t.Count - 1
If Text_t(i).BackColor = &HF2FAEB Then
Text_t(i).Left = Text_t(y).Left
T_Label(i).Left = Text_t(i).Left - T_Label(i).Width - 100
Text_t(i).BackColor = &HFFFFFF
End If
Next i
End Sub
Private Sub HD_Text() '横对
Dim i As Integer: Dim y As Integer
y = 1
For y = 1 To Text_t.Count - 1
If Text_t(y).BackColor = &HF2FAEB Then
For i = 1 To Text_t.Count - 1
If Text_t(i).BackColor = &HF2FAEB Then
If Text_t(y).Top > Text_t(i).Top Then
y = i
End If
End If
Next i
Exit For
End If
Next y
For i = 1 To Text_t.Count - 1
If Text_t(i).BackColor = &HF2FAEB Then
Text_t(i).Top = Text_t(y).Top
T_Label(i).Top = Text_t(i).Top + 50
Text_t(i).BackColor = &HFFFFFF
End If
Next i
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -