home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / code / system / callback / graystri.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-27  |  2.0 KB  |  64 lines

  1. VERSION 2.00
  2. Begin Form frmGrayString 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "GrayStringProc"
  6.    ClientHeight    =   885
  7.    ClientLeft      =   1575
  8.    ClientTop       =   1845
  9.    ClientWidth     =   3285
  10.    Height          =   1290
  11.    Left            =   1515
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   59
  14.    ScaleMode       =   3  'Pixel
  15.    ScaleWidth      =   219
  16.    Top             =   1500
  17.    Width           =   3405
  18.    Begin CheckBox Check1 
  19.       BackColor       =   &H00C0C0C0&
  20.       Caption         =   "Grayed"
  21.       Height          =   255
  22.       Left            =   60
  23.       TabIndex        =   1
  24.       Top             =   480
  25.       Width           =   1455
  26.    End
  27.    Begin PictureBox GrayPhone 
  28.       AutoRedraw      =   -1  'True
  29.       AutoSize        =   -1  'True
  30.       BorderStyle     =   0  'None
  31.       Height          =   345
  32.       Left            =   600
  33.       Picture         =   GRAYSTRI.FRX:0000
  34.       ScaleHeight     =   23
  35.       ScaleMode       =   3  'Pixel
  36.       ScaleWidth      =   117
  37.       TabIndex        =   0
  38.       Top             =   60
  39.       Visible         =   0   'False
  40.       Width           =   1755
  41.    End
  42.    Begin CBVBX ctlGrayString 
  43.       CBType          =   7  ' 7  - GrayStringProc
  44.       Left            =   0
  45.       Top             =   0
  46.    End
  47. Option Explicit
  48. Dim gray&
  49. Sub Check1_Click ()
  50.     gray = Check1.Value
  51.     Me.Refresh
  52. End Sub
  53. Sub ctlGrayString_GrayStringProc (hDC As Integer, lpdata As Long, cch As Integer, retval As Integer)
  54.     Dim success%
  55.     success% = BitBlt(hDC, 0, 0, GrayPhone.Width, GrayPhone.Width, GrayPhone.hDC, 0, 0, SRCCOPY)
  56.     retval = CInt(lpdata)
  57. End Sub
  58. Sub Form_Paint ()
  59.     Dim success%
  60.     Dim hbr%
  61.     hbr = CreateSolidBrush(ByVal RGB(0, 0, 255))
  62.     success% = GrayString%(Me.hDC, hbr, ctlGrayString.CBAdress, gray, -1, 0, 0, GrayPhone.Width, GrayPhone.Height)
  63. End Sub
  64.