home *** CD-ROM | disk | FTP | other *** search
/ Dan Appleman's Visual Bas…s Guide to the Win32 API / Dan.Applmans.Visual.Basic.5.0.Programmers.Guide.To.The.Win32.API.1997.Ziff-Davis.Press.CD / VB5PG32.mdf / vbpg32 / samples5 / ch08 / frmcopy.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-11-27  |  2.1 KB  |  62 lines

  1. VERSION 5.00
  2. Begin VB.Form frmCopy 
  3.    Caption         =   "COPY Pen drawing"
  4.    ClientHeight    =   4755
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1515
  7.    ClientWidth     =   6195
  8.    LinkTopic       =   "Form2"
  9.    PaletteMode     =   1  'UseZOrder
  10.    ScaleHeight     =   4755
  11.    ScaleWidth      =   6195
  12.    Begin VB.PictureBox Picture1 
  13.       DrawMode        =   7  'Invert
  14.       ForeColor       =   &H000000FF&
  15.       Height          =   2895
  16.       Left            =   120
  17.       ScaleHeight     =   2865
  18.       ScaleWidth      =   5925
  19.       TabIndex        =   0
  20.       Top             =   60
  21.       Width           =   5955
  22.    End
  23.    Begin VB.Label Label2 
  24.       Caption         =   "Note: The forecolor on this picturebox is the same as on the other form. The xor drawing mode makes it look different."
  25.       Height          =   375
  26.       Left            =   120
  27.       TabIndex        =   3
  28.       Top             =   4260
  29.       Width           =   6015
  30.    End
  31.    Begin VB.Label Label1 
  32.       Caption         =   "Drag a window over this form. The lines should appear the same. "
  33.       Height          =   255
  34.       Left            =   120
  35.       TabIndex        =   2
  36.       Top             =   3900
  37.       Width           =   5955
  38.    End
  39.    Begin VB.Label lblText 
  40.       Caption         =   $"frmCopy.frx":0000
  41.       Height          =   795
  42.       Left            =   180
  43.       TabIndex        =   1
  44.       Top             =   3000
  45.       Width           =   5895
  46.    End
  47. Attribute VB_Name = "frmCopy"
  48. Attribute VB_GlobalNameSpace = False
  49. Attribute VB_Creatable = False
  50. Attribute VB_PredeclaredId = True
  51. Attribute VB_Exposed = False
  52. Option Explicit
  53. Private Declare Function Rectangle& Lib "gdi32" (ByVal hDC As Long, ByVal x1 As Long, ByVal y1 As Long, ByVal x2 As Long, ByVal y2 As Long)
  54. Private Sub Picture1_Paint()
  55.     Dim dummy&
  56.     Picture1.DrawMode = 13 ' Copy pen
  57.     dummy& = Rectangle&(Picture1.hDC, 10, 10, 380, 180)
  58.     dummy& = Rectangle&(Picture1.hDC, 60, 60, 330, 130)
  59.     dummy& = Rectangle&(Picture1.hDC, 40, 40, 350, 150)
  60.     Picture1.DrawMode = 7 'xor
  61. End Sub
  62.