📄 frmatemsgbox.frm
字号:
VERSION 5.00
Begin VB.Form frmAteMsgBox
BackColor = &H80000005&
BorderStyle = 1 'Fixed Single
Caption = "ATE Message"
ClientHeight = 1830
ClientLeft = 45
ClientTop = 435
ClientWidth = 1995
ControlBox = 0 'False
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1830
ScaleWidth = 1995
StartUpPosition = 2 'CenterScreen
Begin VB.PictureBox picMsg
Appearance = 0 'Flat
AutoSize = -1 'True
BackColor = &H80000005&
ForeColor = &H80000008&
Height = 855
Left = 120
ScaleHeight = 825
ScaleWidth = 1665
TabIndex = 1
Top = 480
Width = 1695
End
Begin VB.CommandButton cmdOK
Caption = "&OK"
Height = 255
Left = 480
TabIndex = 0
Top = 1440
Width = 855
End
Begin VB.Label lblMsg
AutoSize = -1 'True
BackColor = &H80000005&
Caption = "Msg"
BeginProperty Font
Name = "MS Sans Serif"
Size = 18
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 435
Left = 120
TabIndex = 2
Top = 0
UseMnemonic = 0 'False
Width = 690
End
End
Attribute VB_Name = "frmAteMsgBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_TextMsg As String, m_PicturePath As String, m_Title As String
Public Property Let TextMsg(Value As String)
m_TextMsg = Value
End Property
Public Property Let PicturePath(Value As String)
m_PicturePath = Value
End Property
Property Let Title(Value As String)
m_Title = Value
End Property
Private Sub cmdOK_Click()
Unload Me
End Sub
Private Sub Form_Activate()
If m_TextMsg <> "" Then
lblMsg.Visible = True
lblMsg.Caption = m_TextMsg
Else
lblMsg.Visible = False
End If
If m_PicturePath <> "" Then
If Dir(m_PicturePath, vbNormal) = "" Then m_PicturePath = ""
End If
If m_PicturePath <> "" Then
' picture available
With picMsg
.Visible = True
.Picture = LoadPicture(m_PicturePath)
If m_TextMsg <> "" Then
.Top = lblMsg.Top + lblMsg.Height + 100
Else
.Top = lblMsg.Top
End If
End With
With Me
.Width = picMsg.Width + 300
cmdOK.Top = picMsg.Top + picMsg.Height + 100
cmdOK.Left = (.Width - cmdOK.Width) / 2
.Height = cmdOK.Top + cmdOK.Height + 600
End With
Else
'picture not available
picMsg.Visible = False
With Me
.Width = lblMsg.Width + 300
cmdOK.Top = lblMsg.Top + lblMsg.Height + 100
.Height = cmdOK.Top + cmdOK.Height + 600
End With
End If
cmdOK.Left = (Me.Width - cmdOK.Width) / 2
If m_Title <> "" Then
Me.Caption = m_Title
Else
Me.Caption = "ATE Message"
End If
Me.cmdOK.SetFocus
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -