vbAccelerator - Contents of code file: mfMain.frmVERSION 5.00
Begin VB.MDIForm mfMain
BackColor = &H8000000C&
Caption = "Test Bitmap Tiling Component"
ClientHeight = 5310
ClientLeft = 2490
ClientTop = 2190
ClientWidth = 8700
Icon = "mfMain.frx":0000
LinkTopic = "MDIForm1"
Begin VB.Menu mnuFileTOP
Caption = "&File"
Begin VB.Menu mnuFile
Caption = "&New"
Index = 0
End
Begin VB.Menu mnuFile
Caption = "-"
Index = 1
End
Begin VB.Menu mnuFile
Caption = "&Exit"
Index = 2
End
End
Begin VB.Menu mnuViewTOP
Caption = "&View"
Begin VB.Menu mnuView
Caption = "&Background Bitmap..."
Index = 0
End
End
Begin VB.Menu mnuHelpTOP
Caption = "&Help"
Begin VB.Menu mnuHelp
Caption = "&About..."
Index = 0
End
End
End
Attribute VB_Name = "mfMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_cFB As New cFormBackground
Private Sub MDIForm_Load()
With m_cFB
.Init Me
.Tile.filename = App.Path & "\marb_gif.gif"
End With
End Sub
Private Sub mnuFile_Click(Index As Integer)
Select Case Index
Case 0
Dim f As New fTest
f.Show
Case 2
Unload Me
End Select
End Sub
Private Sub mnuHelp_Click(Index As Integer)
frmAbout.Show vbModal, Me
End Sub
Private Sub mnuView_Click(Index As Integer)
On Error GoTo BackBitmapError
Dim cC As New cCommonDialog
With cC
.hWnd = Me.hWnd
.Filter = "Picture Files
(*.BMP;*.DIB;*.GIF;*.JPG)|*.BMP;*.DIB;*.GIF;*.JPG|Bitmap Files
(*.BMP;*.DIB)|*.BMP;*.DIB|GIF Files (*.GIF)|*.GIF|JPEG Files
(*.JPG)|*.JPG|All Files (*.*)|*.*"
.FilterIndex = 1
.flags = OFN_FILEMUSTEXIST Or OFN_PATHMUSTEXIST
.CancelError = True
.ShowOpen
m_cFB.Tile.filename = .filename
m_cFB.Refresh
End With
Exit Sub
BackBitmapError:
If (Err.Number <> 2001) Then
MsgBox "An error occurred: " & Err.Description, vbExclamation
End If
Exit Sub
End Sub
|
|