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 / samples4 / ch08 / frmcopy.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1997-02-16  |  2.2 KB  |  65 lines

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