📄 frmone.frm
字号:
VERSION 5.00
Begin VB.Form frmStarter
Caption = "Fig. 11.16: Using multiple forms"
ClientHeight = 780
ClientLeft = 2730
ClientTop = 420
ClientWidth = 4365
LinkTopic = "Form1"
ScaleHeight = 780
ScaleWidth = 4365
Begin VB.CommandButton cmdJava
Caption = "Java"
Height = 495
Left = 2895
TabIndex = 2
Top = 120
Width = 1215
End
Begin VB.CommandButton cmdCpp
Caption = "C++"
Height = 495
Left = 1575
TabIndex = 1
Top = 120
Width = 1215
End
Begin VB.CommandButton cmdC
Caption = "C"
Height = 495
Left = 255
TabIndex = 0
Top = 120
Width = 1215
End
End
Attribute VB_Name = "frmStarter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' Form frmStarter
Option Explicit ' General declaration frmStarter
Option Base 1
Dim mImagesArray(3) As IPictureDisp
Private Sub Form_Load()
Set mImagesArray(1) = LoadPicture("d:\images\ch11\" & _
"chtp2.gif")
Set mImagesArray(2) = LoadPicture("d:\images\ch11\" & _
"cpphtp2.gif")
Set mImagesArray(3) = LoadPicture("d:\images\ch11\" & _
"jhtp2.gif")
End Sub
Private Sub cmdC_Click()
frmForm1.imgImage.Picture = mImagesArray(1)
Call frmForm1.Show(vbModal) ' Display the form
End Sub
Private Sub cmdCpp_Click()
frmForm2.imgImage.Picture = mImagesArray(2)
Call frmForm2.Show(vbModal) ' Display the form
End Sub
Private Sub cmdJava_Click()
frmForm3.imgImage.Picture = mImagesArray(3)
Call frmForm3.Show(vbModal) ' Display the form
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim r As Integer
r = MsgBox("Are you sure you want to exit?", vbYesNo, _
"VB6HTP: Fig. 11.16")
If r = vbNo Then
Cancel = True ' Allow Form_Unload to be called
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call Unload(frmForm1) ' Unload frmForm1
Call Unload(frmForm2) ' Unload frmForm2
Call Unload(frmForm3) ' Unload frmForm3
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -