home *** CD-ROM | disk | FTP | other *** search
- VERSION 4.00
- Begin VB.Form frmReturn
- BorderStyle = 0 'None
- ClientHeight = 1125
- ClientLeft = 1080
- ClientTop = 1515
- ClientWidth = 2760
- Height = 1530
- Icon = "FRMRET.frx":0000
- Left = 1020
- LinkTopic = "Form1"
- ScaleHeight = 75
- ScaleMode = 3 'Pixel
- ScaleWidth = 184
- ShowInTaskbar = 0 'False
- Top = 1170
- Width = 2880
- Begin VB.PictureBox picReturn
- Appearance = 0 'Flat
- AutoRedraw = -1 'True
- BackColor = &H00C0C0C0&
- BeginProperty Font
- name = "Arial"
- charset = 0
- weight = 700
- size = 8.25
- underline = 0 'False
- italic = 0 'False
- strikethrough = 0 'False
- EndProperty
- ForeColor = &H80000008&
- Height = 645
- Left = 0
- ScaleHeight = 41
- ScaleMode = 3 'Pixel
- ScaleWidth = 173
- TabIndex = 0
- Top = 0
- Width = 2625
- End
- Attribute VB_Name = "frmReturn"
- Attribute VB_Creatable = False
- Attribute VB_Exposed = False
- '*********************************************************************
- ' FRMRET.FRM - This form is a picture button that provides a generic
- ' way to return to your app from Excel & Word.
- '*********************************************************************
- Option Explicit
- Option Compare Text
- Private frmCaller As Form
- '*********************************************************************
- ' Calling forms should display this form by calling its Display
- ' Method. This allows the form to know who displayed it, so it can
- ' set the focus back to the calling form when frmReturn is unloaded.
- '*********************************************************************
- Public Sub Display(frmCallingForm As Form)
- Set frmCaller = frmCallingForm
- Show
- End Sub
- '*********************************************************************
- ' Position the form and button to the same size in the upper right
- ' corner so they block the Minimize & Maximize buttons.
- '*********************************************************************
- Private Sub Form_Load()
- Dim XTwips%, YTwips%
- XTwips = Screen.TwipsPerPixelX
- YTwips = Screen.TwipsPerPixelY
- picReturn.BackColor = vb3DFace
- '*****************************************************************
- ' Size the control, THEN move it to the uppper right corner.
- '*****************************************************************
- Move Left, top, 200 * XTwips, 43.4 * YTwips
- Move Screen.Width - Width, 0
- picReturn.Move 0, 0, 200, 43.4
- '*****************************************************************
- ' Prevent the window from being covered up, and draw the button.
- '*****************************************************************
- AlwaysOnTop Me, True
- Handle_MouseUpDown False
- End Sub
- '*********************************************************************
- ' Handle drawing the button in its various states. Notice how we use
- ' to DrawButton routine from frmMain.
- '*********************************************************************
- Private Sub Handle_MouseUpDown(bState As Boolean)
- DrawButton picReturn, IsDown:=bState, _
- sCaption:="Return to " & App.Title & "...", _
- sIcon:="RETURN", IsResource:=True
- End Sub
- '*********************************************************************
- ' Simulate a button click via graphics methods.
- '*********************************************************************
- Private Sub picReturn_MouseDown(Button%, Shift%, x As Single, y As Single)
- Handle_MouseUpDown True
- End Sub
- Private Sub picReturn_MouseUp(Button%, Shift%, x As Single, y As Single)
- Handle_MouseUpDown False
- End Sub
- '*********************************************************************
- ' Show the calling form, and unload this window.
- '*********************************************************************
- Private Sub picReturn_Click()
- frmCaller.Show
- '*****************************************************************
- ' The calling form should have a public DestroyObject method to do
- ' any necessary cleanup (i.e., destroying it OLE Automation
- ' object variables).
- '*****************************************************************
- frmCaller.DestroyObject
- Unload Me
- End Sub
-