📄 企业基本资料.frm
字号:
VERSION 5.00
Object = "{C932BA88-4374-101B-A56C-00AA003668DC}#1.1#0"; "MSMASK32.OCX"
Begin VB.Form qyjbzl
BorderStyle = 0 'None
Caption = "企业基本资料"
ClientHeight = 3555
ClientLeft = 0
ClientTop = 0
ClientWidth = 5880
Icon = "企业基本资料.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
Picture = "企业基本资料.frx":11C2
ScaleHeight = 237
ScaleMode = 3 'Pixel
ScaleWidth = 392
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.ComboBox Combo1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 360
Left = 1500
TabIndex = 11
Top = 2250
Width = 2415
End
Begin MSMask.MaskEdBox MaskEdBox1
Height = 375
Left = 3870
TabIndex = 10
Top = 1710
Width = 1845
_ExtentX = 3254
_ExtentY = 661
_Version = 393216
MaxLength = 13
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Mask = "####-########"
PromptChar = "_"
End
Begin VB.PictureBox Picture1
Appearance = 0 'Flat
BackColor = &H80000005&
BorderStyle = 0 'None
ForeColor = &H80000008&
Height = 345
Left = 0
Picture = "企业基本资料.frx":59044
ScaleHeight = 345
ScaleWidth = 5895
TabIndex = 0
Top = 0
Width = 5895
Begin VB.Image Image7
Height = 345
Left = 4740
Picture = "企业基本资料.frx":5FC56
Top = 360
Width = 345
End
Begin VB.Image Image6
Height = 345
Left = 5430
Picture = "企业基本资料.frx":60310
Top = 30
Width = 345
End
Begin VB.Label Label2
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "修改公司基本资料"
BeginProperty Font
Name = "宋体"
Size = 9
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H8000000E&
Height = 180
Left = 480
TabIndex = 9
Top = 90
Width = 1560
End
Begin VB.Image Image5
Height = 345
Left = 30
Picture = "企业基本资料.frx":609CA
Top = 0
Width = 345
End
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 2
Left = 1500
TabIndex = 8
Top = 1710
Width = 1065
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 1
Left = 1500
TabIndex = 7
Top = 1200
Width = 4215
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Index = 0
Left = 1500
TabIndex = 6
Top = 660
Width = 4215
End
Begin VB.Image Image9
Height = 375
Left = 2820
Picture = "企业基本资料.frx":61084
Top = 4680
Width = 1125
End
Begin VB.Image Image8
Height = 375
Left = 4350
Picture = "企业基本资料.frx":653B2
Top = 2250
Width = 1125
End
Begin VB.Shape Shape1
Height = 2235
Left = 60
Top = 540
Width = 5745
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "公司电话:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 4
Left = 2700
TabIndex = 5
Top = 1845
Width = 1155
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "所在地:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 3
Left = 570
TabIndex = 4
Top = 1845
Width = 915
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单位地址:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 2
Left = 330
TabIndex = 3
Top = 1335
Width = 1155
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "单位名称:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 1
Left = 330
TabIndex = 1
Top = 810
Width = 1155
End
Begin VB.Label Label1
AutoSize = -1 'True
BackStyle = 0 'Transparent
Caption = "发件人姓名:"
BeginProperty Font
Name = "宋体"
Size = 12
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Index = 0
Left = 90
TabIndex = 2
Top = 2370
Width = 1395
End
Begin VB.Image Image4
Height = 375
Left = 240
Picture = "企业基本资料.frx":69541
Top = 4800
Width = 1125
End
Begin VB.Image Image3
Height = 375
Left = 1560
Picture = "企业基本资料.frx":6D979
Top = 4830
Width = 1125
End
Begin VB.Image Image2
Height = 375
Left = 4590
Picture = "企业基本资料.frx":71EBE
Top = 2970
Width = 1125
End
Begin VB.Image Image1
Height = 375
Left = 3060
Picture = "企业基本资料.frx":7628B
Top = 2970
Width = 1125
End
End
Attribute VB_Name = "qyjbzl"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim rs As ADODB.Recordset
Dim IDmax As Integer
Dim Company_Info As String
Public Sub ShowText()
Dim qb() As String
sqltext = "select * from 公司资料"
Set rs = ExecuteSQL(sqltext, MsgString)
If Not (rs.EOF And rs.BOF) Then
Text1(0) = rs(0)
Text1(1) = rs(1)
Text1(2) = rs(2)
qb = Split(rs(3), "-", 2)
If Len(qb(0)) = 3 Then
qb(0) = "0" + qb(0)
End If
MaskEdBox1.Text = qb(0) + "-" + qb(1)
Label2.Caption = "修改企业基本资料"
Else
Company_Info = "nodata"
Label2.Caption = "企业基本资料"
End If
Combo1.Clear
sqltext = "select * from 发件人表 order by 发件人ID asc"
Set rs = ExecuteSQL(sqltext, MsgString)
If rs.EOF And rs.BOF Then
IDmax = "100"
Exit Sub
Else
Do Until rs.EOF
IDmax = Val(rs(0))
Combo1.AddItem rs(1)
rs.MoveNext
Loop
End If
Combo1.Text = Combo1.List(0)
End Sub
Private Sub Form_Load()
'设置动态按钮
Image4.Move -3000, Image1.Top
Image3.Move -3000, Image2.Top
Image7.Move -3000, Image6.Top
Image9.Move -3000, Image6.Top
Call ShowText
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'还原按钮状态
Image9.Move -3000, Image6.Top
Image4.Move -3000, Image1.Top
Image3.Move -3000, Image2.Top
Image7.Move -3000, Image6.Top
End Sub
Private Sub Image4_Click()
'确定
If Company_Info = "nodata" Then
sqltext = "insert into 公司资料 values('" & Trim(Text1(0)) & "','" & Trim(Text1(1))
sqltext = sqltext & "','" & Trim(Text1(2)) & "','" & MaskEdBox1.Text & "')"
Set rs = ExecuteSQL(sqltext, MsgString)
Else
sqltext = "update 公司资料 set 单位名称='" & Trim(Text1(0)) & "',单位地址='" & Trim(Text1(1))
sqltext = sqltext & "',所在地='" & Trim(Text1(2)) & "',联系电话='" & MaskEdBox1.Text & "'"
Set rs = ExecuteSQL(sqltext, MsgString)
End If
Unload Me
End Sub
Private Sub image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image4.Move Image1.Left, Image1.Top
End Sub
Private Sub Image3_Click()
'取消
Unload Me
End Sub
Private Sub Image2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'切入图片
Image3.Move Image2.Left, Image2.Top
End Sub
Private Sub Image5_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&
End If
End Sub
Private Sub Image6_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'切入图片
Image7.Move Image6.Left, Image6.Top
End Sub
Private Sub Image7_Click()
Unload Me
End Sub
Private Sub Image8_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image9.Move Image8.Left, Image8.Top
End Sub
Private Sub Image9_Click()
Dim rs1 As ADODB.Recordset
If Combo1.Text = "" Then
Exit Sub
Else
sqltext = "select * from 发件人表 where 发件人姓名 ='" & Trim(Combo1.Text) & "'"
Set rs = ExecuteSQL(sqltext, MsgString)
If rs.EOF And rs.BOF Then
sqltext = "insert into 发件人表 values('" & Trim(Str(IDmax + 1)) & "','" & Trim(Combo1.Text) & "')"
Set rs1 = ExecuteSQL(sqltext, MsgString)
Call ShowText
Exit Sub
Else
MsgBox "发件人姓名已经存在", vbInformation, "提示"
End If
End If
Combo1.Text = ""
End Sub
Private Sub Label2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&
End If
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
ReleaseCapture
SendMessage Me.hwnd, WM_NCLBUTTONDOWN, HTCAPTION, ByVal 0&
End If
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'还原按钮状态
Image7.Move -3000, Image6.Top
End Sub
Private Sub Text1_GotFocus(Index As Integer)
Text1(Index).SelStart = 0
Text1(Index).SelLength = Len(Text1(Index))
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -