【VB开源代码栏目提醒】:网学会员为广大网友收集整理了,frmBOX.frm,希望对大家有所帮助!
VERSION 5.00
Begin VB.Form frmBOX
BorderStyle = 3 'Fixed Dialog
Caption = "Message"
ClientHeight = 3015
ClientLeft = 45
ClientTop = 330
ClientWidth = 4170
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3015
ScaleWidth = 4170
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.CommandButton cmdOK
Caption = "OK"
Default = -1 'True
Height = 375
Left = 1560
TabIndex = 1
Top = 2520
Width = 1095
End
Begin VB.Label lblMSG
Alignment = 1 'Right Justify
AutoSize = -1 'True
Caption = "lblMSG"
BeginProperty Font
Name = "MS Sans Serif"
Size = 9.75
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 240
Left = 120
TabIndex = 0
Top = 90
Width = 660
End
End
Attribute
VB_Name = "frmBOX"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'
'
Option Explicit
Private Sub Form_Load()
Me.Icon = frmMenu.Icon
End Sub
Public Sub ShowMsg(ByRef sMessage As String, ByRef ownerForm As Form)
' case this form is still visible (not closed yet),
' then add new message to previous.
If Not Me.Visible Then
lblMSG.Caption = sMessage
Else
lblMSG.Caption = lblMSG.Caption & vbNewLine _
& vbNewLine & sMessage
End If
' center the label in the form
' (doesn't count the "OK" button):
lblMSG.Left = Me.ScaleWidth / 2 - lblMSG.Width / 2
lblMSG.Top = cmdOK.Top / 2 - lblMSG.Height / 2
Me.Show , ownerForm
End Sub
Private Sub cmdOK_Click()
Me.Hide
End Sub