home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmAbout
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "About the Demo"
- ClientHeight = 3795
- ClientLeft = 2265
- ClientTop = 1650
- ClientWidth = 5595
- Height = 4200
- Left = 2205
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 3795
- ScaleWidth = 5595
- Top = 1305
- Width = 5715
- Begin TextBox txtAbout
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00800000&
- Height = 3015
- Left = 120
- MultiLine = -1 'True
- ScrollBars = 2 'Vertical
- TabIndex = 1
- Text = "This demonstration program is part of the ""Visual Basic Controls Gigabible"" Examples disk."
- Top = 180
- Width = 5355
- End
- Begin CommandButton btnOK
- Cancel = -1 'True
- Caption = "&OK"
- Default = -1 'True
- Height = 375
- Left = 2280
- TabIndex = 0
- Top = 3300
- Width = 1095
- End
- Option Explicit
- ' Color Constants
- Const DARK_GRAY = &H808080
- Const WHITE = &HFFFFFF
- Const BLACK = &H0
- ' Maximum allowable title string length
- Const MAX_TITLE_LEN = 80
- Sub btnOK_Click ()
- '--------------------------------------------------
- ' Close the About window.
- '--------------------------------------------------
- Unload Me
- End Sub
- Sub Form_Load ()
- '--------------------------------------------------
- ' Try to read the text file "frmabout.txt" in the
- ' application's subdirectory and display its contents
- ' in the about box. Use the first line as the
- ' About window caption.
- '--------------------------------------------------
- Dim FileName As String
- Dim fnum As Integer
- Dim InText As String
- Dim pos As Integer
- On Error Resume Next
- ' Build the file name.
- FileName = App.Path
- If Right$(FileName, 1) <> "\" Then FileName = FileName & "\"
- FileName = FileName & "frmabout.txt"
- ' Read in the file.
- fnum = FreeFile
- Open FileName For Input As fnum
- InText = Input$(FileLen(FileName), fnum)
- ' Load the text into the caption and text control.
- pos = InStr(InText, Chr$(13) & Chr$(10))
- If (pos < MAX_TITLE_LEN) And (pos > 0) Then
- Me.Caption = Left$(InText, pos - 1)
- txtAbout.Text = Mid$(InText, pos + 2)
- ElseIf pos > 0 Then
- Me.Caption = "About the " & App.Title & " Demo"
- txtAbout.Text = InText
- End If
- ' Center the form.
- Me.Move (Screen.Width - Me.Width) \ 2, (Screen.Height - Me.Height) \ 2
- End Sub
- Sub Form_Paint ()
- '--------------------------------------------------
- ' Paint the 3D effect arounf the text box.
- '--------------------------------------------------
- Make3D Me, txtAbout
- End Sub
- Sub Make3D (pic As Form, ctl As Control)
- '--------------------------------------------------
- ' Wrap a 3D effect around a control on a form.
- '--------------------------------------------------
- Dim AdjustX As Integer, AdjustY As Integer
- Dim RightSide As Single
- AdjustX = Screen.TwipsPerPixelX
- AdjustY = Screen.TwipsPerPixelY
- ' Set the top shading line.
- pic.Line (ctl.Left - AdjustX, ctl.Top - AdjustY)-(ctl.Left + ctl.Width, ctl.Top - AdjustY), DARK_GRAY
- pic.Line -(ctl.Left + ctl.Width, ctl.Top + ctl.Height), WHITE
- pic.Line -(ctl.Left - AdjustX, ctl.Top + ctl.Height), WHITE
- pic.Line -(ctl.Left - AdjustX, ctl.Top - AdjustY), DARK_GRAY
- End Sub
- Sub txtAbout_KeyPress (KeyAscii As Integer)
- '--------------------------------------------------
- ' Prevent accidental editing of help text.
- '--------------------------------------------------
- KeyAscii = 0
- End Sub
-