home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / tbsrc / file7.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-10-09  |  4.2 KB  |  140 lines

  1. VERSION 2.00
  2. Begin Form wndToolBar 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Toolbar"
  5.    ClientHeight    =   2040
  6.    ClientLeft      =   570
  7.    ClientTop       =   1770
  8.    ClientWidth     =   4215
  9.    ControlBox      =   0   'False
  10.    FontBold        =   0   'False
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Serif"
  13.    FontSize        =   6
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   2445
  17.    Left            =   510
  18.    LinkTopic       =   "Form1"
  19.    MaxButton       =   0   'False
  20.    MinButton       =   0   'False
  21.    ScaleHeight     =   136
  22.    ScaleMode       =   3  'Pixel
  23.    ScaleWidth      =   281
  24.    Top             =   1425
  25.    Width           =   4335
  26.    Begin PictureBox Toolbar 
  27.       AutoRedraw      =   -1  'True
  28.       BackColor       =   &H00C0C0C0&
  29.       BorderStyle     =   0  'None
  30.       ClipControls    =   0   'False
  31.       Height          =   855
  32.       Left            =   0
  33.       ScaleHeight     =   855
  34.       ScaleWidth      =   4215
  35.       TabIndex        =   0
  36.       Top             =   135
  37.       Width           =   4215
  38.    End
  39. Option Explicit
  40. Dim StartExit               As Integer
  41. Dim StartInit               As Integer
  42. Dim Titel                   As String
  43. Sub Form_Activate ()
  44.     StartInit = False
  45.     SizeControl Toolbar
  46.     If Me.WindowState <> 0 Then Beep: Me.WindowState = 0
  47.     vbQHCalcToolPos Toolbar
  48.     Toolbar.Refresh
  49.     If Me.WindowState <> 0 Then Me.WindowState = 0
  50.     ChangeBar = False
  51. End Sub
  52. Sub Form_DblClick ()
  53.     StartExit = -StartExit
  54. End Sub
  55. Sub Form_Load ()
  56. Dim h As Integer
  57. Dim col As Long
  58.     StartInit = True
  59.     Titel = Me.Caption
  60.     Me.Tag = Titel
  61.     Me.Caption = Chr$(0)
  62.     Me.AutoRedraw = True
  63.     Me.Move GetSystemMetrics(0) * Screen.TwipsPerPixelX, GetSystemMetrics(1) * Screen.TwipsPerPixelY
  64.     Me.AutoRedraw = False
  65.     Me.Refresh
  66.     SetChild Me.hWnd, MDIParent.hWnd, True
  67. End Sub
  68. Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
  69. Dim dc As Integer
  70. Dim dx As Integer, dy As Integer
  71. Dim mPos As apiPoint
  72. Dim oldpos As apiPoint
  73. Dim mRect As apiRect
  74.     StartExit = False
  75.     If Y < 9 Then
  76.         If X > 10 Then
  77.             vbQHFakeMove Me
  78.         Else
  79.             Me.DrawMode = 6
  80.             If Me.BorderStyle Then
  81.                 Me.Line (0, 0)-(10, 7), 0, BF
  82.             Else
  83.                 Me.Line (1, 1)-(10, 7), 0, BF
  84.             End If
  85.             StartExit = True
  86.             Me.DrawMode = 13
  87.         End If
  88.     End If
  89. End Sub
  90. Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
  91.     Me.DrawMode = 13
  92.     Me.Cls
  93.     If StartExit = 1 Then Unload Me
  94. End Sub
  95. Sub Form_Paint ()
  96. Dim w As Integer, h As Integer
  97. Dim col As Long
  98. Static IsPainting As Integer
  99.     If StartInit Then Exit Sub
  100.     If IsPainting Then Exit Sub
  101.     IsPainting = True
  102.     w = Me.ScaleWidth
  103.     Me.AutoRedraw = True
  104.     If Me.BorderStyle Then
  105.         h = 0
  106.     Else
  107.         h = 1
  108.     End If
  109.     Me.Line (0, 0)-(10, 10), RGB(192, 192, 192), BF
  110.     col = GetSysColor(2)
  111.     Me.Line (12, h)-(w - 1, 7), col, BF         ' Titelleiste
  112.     Me.Line (h, 8)-(w, 8), 0                    ' Linie unter Titel
  113.     Me.Line (11, h)-(11, 8), 0                  ' Linie links von Titel
  114.     Me.ForeColor = GetSysColor(9)
  115.     Me.CurrentX = 11 + (Me.ScaleWidth - 12 - Me.TextWidth(Titel)) / 2
  116.     Me.CurrentY = -1
  117.     If Me.CurrentX > 11 Then Me.Print Titel
  118.     Me.Line (3, 2 + h)-(8, 4 + h), 0, B             ' Schwarzes Rechteck
  119.     Me.Line (4, 3 + h)-(8, 3 + h), RGB(255, 255, 255)' Weiss f
  120.     Me.Line (4, 5 + h)-(9, 5 + h), RGB(128, 128, 128)' Schatten unten
  121.     Me.Line (9, 3 + h)-(9, 6 + h), RGB(128, 128, 128)' Schatten rechts
  122.     Me.AutoRedraw = False
  123.     Me.Refresh
  124.     IsPainting = False
  125. End Sub
  126. Sub Form_Resize ()
  127.     If Not StartInit Then
  128.         SizeControl Toolbar
  129.         If Me.WindowState <> 0 Then Me.WindowState = 0
  130.         vbQHCalcToolPos Toolbar
  131.         Me.Refresh
  132.     End If
  133. End Sub
  134. Sub Form_Unload (Cancel As Integer)
  135.     vbQHExit Me
  136. End Sub
  137. Sub Toolbar_MouseMove (Button As Integer, Shift As Integer, X As Single, Y As Single)
  138.     vbQHelpExt Toolbar
  139. End Sub
  140.