home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / mabry / picbtn11 / sample / psample2.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-11-18  |  4.1 KB  |  132 lines

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "PicBtn Sample 2"
  6.    ClientHeight    =   1110
  7.    ClientLeft      =   1815
  8.    ClientTop       =   2145
  9.    ClientWidth     =   2910
  10.    Height          =   1515
  11.    Left            =   1755
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   1110
  16.    ScaleWidth      =   2910
  17.    Top             =   1800
  18.    Width           =   3030
  19.    Begin MabryPictureButton Justify 
  20.       AutoSize        =   0   'False
  21.       ButtonColor     =   &H00C0C0C0&
  22.       Caption         =   "Justify"
  23.       FontBold        =   0   'False
  24.       FontItalic      =   0   'False
  25.       FontName        =   "MS Sans Serif"
  26.       FontSize        =   8.25
  27.       FontStrikethru  =   0   'False
  28.       FontUnderline   =   0   'False
  29.       Gap             =   4
  30.       Height          =   615
  31.       Index           =   3
  32.       Left            =   2040
  33.       Mode            =   2  'Manual
  34.       PictureUp       =   PSAMPLE2.FRX:0000
  35.       Placement       =   1  'Above text
  36.       TabIndex        =   3
  37.       Top             =   240
  38.       Width           =   615
  39.    End
  40.    Begin MabryPictureButton Justify 
  41.       AutoSize        =   0   'False
  42.       ButtonColor     =   &H00C0C0C0&
  43.       Caption         =   "Right"
  44.       FontBold        =   0   'False
  45.       FontItalic      =   0   'False
  46.       FontName        =   "MS Sans Serif"
  47.       FontSize        =   8.25
  48.       FontStrikethru  =   0   'False
  49.       FontUnderline   =   0   'False
  50.       Gap             =   4
  51.       Height          =   615
  52.       Index           =   2
  53.       Left            =   1440
  54.       Mode            =   2  'Manual
  55.       PictureUp       =   PSAMPLE2.FRX:00D2
  56.       Placement       =   1  'Above text
  57.       TabIndex        =   2
  58.       Top             =   240
  59.       Width           =   615
  60.    End
  61.    Begin MabryPictureButton Justify 
  62.       AutoSize        =   0   'False
  63.       ButtonColor     =   &H00C0C0C0&
  64.       Caption         =   "Center"
  65.       FontBold        =   0   'False
  66.       FontItalic      =   0   'False
  67.       FontName        =   "MS Sans Serif"
  68.       FontSize        =   8.25
  69.       FontStrikethru  =   0   'False
  70.       FontUnderline   =   0   'False
  71.       Gap             =   4
  72.       Height          =   615
  73.       Index           =   1
  74.       Left            =   840
  75.       Mode            =   2  'Manual
  76.       PictureUp       =   PSAMPLE2.FRX:01A4
  77.       Placement       =   1  'Above text
  78.       TabIndex        =   1
  79.       Top             =   240
  80.       Width           =   615
  81.    End
  82.    Begin MabryPictureButton Justify 
  83.       AutoSize        =   0   'False
  84.       ButtonColor     =   &H00C0C0C0&
  85.       Caption         =   "Left"
  86.       FontBold        =   0   'False
  87.       FontItalic      =   0   'False
  88.       FontName        =   "MS Sans Serif"
  89.       FontSize        =   8.25
  90.       FontStrikethru  =   0   'False
  91.       FontUnderline   =   0   'False
  92.       Gap             =   4
  93.       Height          =   615
  94.       Index           =   0
  95.       Left            =   240
  96.       Mode            =   2  'Manual
  97.       PictureUp       =   PSAMPLE2.FRX:0276
  98.       Placement       =   1  'Above text
  99.       TabIndex        =   0
  100.       Top             =   240
  101.       Width           =   615
  102.    End
  103. Option Explicit
  104. Sub Form_Load ()
  105.     Justify(0).Value = True ' starts down
  106. End Sub
  107. Sub Justify_MouseDown (Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  108.     Dim I As Integer
  109.     '
  110.     ' if this isn't the left mouse button, get out
  111.     '
  112.     If (Button <> 1) Then
  113.         Exit Sub
  114.     End If
  115.     '
  116.     ' cycle through all buttons
  117.     '
  118.     For I = 0 To 3
  119.         If I = Index Then
  120.             '
  121.             ' lower the button that was pressed
  122.             '
  123.             Justify(I).Value = True
  124.         Else
  125.             '
  126.             ' raise the buttons that weren't
  127.             '
  128.             Justify(I).Value = False
  129.         End If
  130.     Next I
  131. End Sub
  132.