Results 1 to 2 of 2

Thread: Xor Draw mode?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    19

    Xor Draw mode?

    hi,
    i have written the following code in which when the button is pressed first time ,a line is drawn,but when the button is pressed 2nd time the drawing mode becomes Xor Pen which is 7.after that the line is drawn at the same place as before.According to Xor mode if any thing drawn over the same thing,then that thing is erased and back pixels are shown.Please tell me that what is wrong with this code?, because it is not working.
    thanx

    Dim button As Integer

    Private Sub Command1_Click()

    If button = 1 Then
    Form1.DrawMode = 7
    Form1.Line (100, 100)-(800, 800)

    End If

    If button = 0 Then
    Form1.Line (100, 100)-(800, 800)
    button = 1
    End If


    End Sub

  2. #2
    PowerPoster
    Join Date
    Aug 2002
    Location
    NY, NY
    Posts
    2,139
    Mot sure what are you after, but perhaps this:
    VB Code:
    1. Private Sub Command1_Click()
    2. Static button As Integer
    3.  
    4.     Me.Cls
    5.     button = IIf(button = 0, 1, 0)
    6.     Me.DrawMode = IIf(Me.DrawMode = 7, 13, 7)
    7.     Form1.Line (100, 100)-(800, 800)
    8.  
    9. End Sub
    Roy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width