📄 form1.frm
字号:
End
Begin VB.Label Label11
BackColor = &H00C0FFC0&
Caption = "查上线工号"
Height = 255
Left = 5280
TabIndex = 24
Top = 1320
Width = 1215
End
Begin VB.Label Label10
BackColor = &H00C0FFC0&
Caption = "设备号查机台"
Height = 255
Left = 3600
TabIndex = 23
Top = 1320
Width = 1215
End
Begin VB.Label Label9
BackColor = &H00C0FFC0&
Caption = "经过站别量"
Height = 255
Left = 1920
TabIndex = 22
Top = 1320
Width = 1215
End
Begin VB.Label Label8
BackColor = &H00C0FFC0&
Caption = "工单已投量"
Height = 255
Left = 480
TabIndex = 21
Top = 1320
Width = 975
End
Begin VB.Label Label4
BackColor = &H00C0FFC0&
Caption = "机台资料"
Height = 255
Left = 480
TabIndex = 20
Top = 840
Width = 1095
End
Begin VB.Label Label7
BackColor = &H00C0FFC0&
Caption = "附件号查机台"
Height = 255
Left = 1920
TabIndex = 19
Top = 840
Width = 1215
End
Begin VB.Label Label6
BackColor = &H00C0FFC0&
Caption = "流 程"
Height = 255
Left = 3600
TabIndex = 18
Top = 840
Width = 735
End
Begin VB.Label Label5
BackColor = &H00C0FFC0&
Caption = "机台查箱号"
Height = 255
Left = 5280
TabIndex = 17
Top = 840
Width = 1095
End
End
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
CausesValidation= 0 'False
Height = 5535
Left = 0
TabIndex = 1
Top = 2040
Width = 11175
_ExtentX = 19711
_ExtentY = 9763
_Version = 393216
BackColor = 16777215
BackColorBkg = 12648384
WordWrap = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "Arial"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin VB.Image Image3
Height = 570
Left = 0
Picture = "Form1.frx":54E78
Top = 7560
Width = 11160
End
Begin VB.Label Label2
BackColor = &H00C0FFC0&
BeginProperty Font
Name = "黑体"
Size = 18
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor = &H0000C000&
Height = 375
Left = 0
TabIndex = 2
Top = 7560
Width = 11295
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private sql As String
Private time1 As Long
Private Sub Command1_Click()
Call Text1_KeyPress(13)
End Sub
Private Sub Command2_Click()
Call Text1_KeyPress(13)
End Sub
Private Sub Command3_Click()
Call Text1_KeyPress(13)
End Sub
Private Sub Command4_Click()
Dim i As String
Dim excel As excel.Application
Dim work As excel.Workbook
Set excel = New excel.Application
Set work = excel.Workbooks.Add
excel.Visible = True
'excel.Range("i" & "2") = "FrmReport.LstViResu5xt"
Dim a, b, c, d, e, v, z As Long
a = MSFlexGrid1.Rows
z = MSFlexGrid1.Cols
'算出序号出来
For c = 0 To a '把内容填进去
If c = a Then
Exit For
End If
For b = 0 To z
If b = z Then
Exit For
End If
If b < 26 Then
excel.Range(Chr(65 + b) & c + 1) = "'" & MSFlexGrid1.TextMatrix(c, b)
ElseIf b < 52 Then
excel.Range("a" & Chr(39 + b) & c + 1) = "'" & MSFlexGrid1.TextMatrix(c, b)
Else
excel.Range("a" & Chr(13 + b) & c + 1) = "'" & MSFlexGrid1.TextMatrix(c, b)
End If
Next b
Next c
excel.Range("A1:AZ" & a).Select
With excel.Selection
.Font.Name = "宋体"
.Font.Size = 10
'.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
With excel.Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.WrapText = False
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
.EntireColumn.AutoFit
End With
excel.Range("A1:AZ1").Select
With excel.Selection
.Font.Name = "宋体"
.Font.Size = 10
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = 0
.AddIndent = False
.ShrinkToFit = False
.MergeCells = False
End With
End Sub
Private Sub Form_Click()
Text2.Visible = False
End Sub
Private Sub Form_Load()
Text2.Visible = False
MSFlexGrid1.Visible = False
Text3.Visible = False
Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
Option1.Value = True
Image3.Visible = False
Label2.Caption = "welcome!"
connection
End Sub
Private Sub Form_Resize()
MSFlexGrid1.Width = Me.Width - 500
If Me.Height - 3000 < 0 Then
MSFlexGrid1.Height = 100
Else
MSFlexGrid1.Height = Me.Height - 3000
End If
Image3.Top = MSFlexGrid1.Height + MSFlexGrid1.Top
Image3.Width = MSFlexGrid1.Width
End Sub
Private Sub Frame1_Click()
Text2.Visible = False
End Sub
Private Sub Frame2_Click()
Text2.Visible = False
End Sub
Private Sub Frame3_Click()
Text2.Visible = False
End Sub
Private Sub Image1_Click()
Text2.Visible = False
End Sub
Private Sub Image3_Click()
Text2.Visible = False
End Sub
Private Sub Image4_Click()
Text2.Visible = False
End Sub
Private Sub Image5_Click()
Text2.Visible = False
End Sub
Private Sub Image6_Click()
Form2.Show
End Sub
Private Sub Image7_Click()
Form3.Show
End Sub
Private Sub Image8_Click()
Form4.Show
End Sub
Private Sub Label2_Click()
Text2.Visible = False
End Sub
Private Sub MSFlexGrid1_Click()
Dim c As Integer, r As Integer
If MSFlexGrid1.MouseCol = 0 Or MSFlexGrid1.MouseRow = 0 Then Exit Sub
With MSFlexGrid1
c = .Col
r = .Row
If c > 0 And r > 0 Then
Text2.Left = .Left + .ColPos(c) + 50
Text2.Top = .Top + .RowPos(r) + 50
Text2.Width = .ColWidth(c)
Text2.Text = .Text
Text2.Visible = True
End If
End With
Text2.SetFocus
SendKeys "{home}+{end}"
End Sub
Private Sub MSFlexGrid1_Scroll()
Dim c As Integer, r As Integer
With MSFlexGrid1
c = .Col
r = .Row
If c > 0 And r > 0 Then
Text2.Left = .Left + .ColPos(c) + 50
Text2.Top = .Top + .RowPos(r) + 50
Text2.Width = .ColWidth(c)
Text2.Text = .Text
Text2.Visible = True
Text2.SetFocus
End If
If Text2.Left < .Left + .ColWidth(0) Then Text2.Visible = False
If Text2.Left > .Left + .Width - .ColWidth(c) Then Text2.Visible = False
If Text2.Top < .Top + .RowHeight(0) Then Text2.Visible = False
If Text2.Top > .Top + .Height - .RowHeight(r) Then Text2.Visible = False
SendKeys "{home}+{end}"
End With
End Sub
Private Sub Option1_Click()
Text2.Visible = False
End Sub
Private Sub Option10_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option11_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option12_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option13_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option14_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option15_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
Private Sub Option16_Click()
Text1.SetFocus
Text2.Visible = False
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -