hi.
i have a panel in a form and a button. iwant to write a program that when i push the button,a circle
be drawn in panel but problem is here. because the handler in button is eventArgs but the panel
is paintEventArgs.
can someone give me a suggestion for doing this.
thanks in advance.

No need to convert.

    Public Class Invalidate_Circle_On_Circle
        Dim ShowCircle As Boolean

        Private Sub MyPanel_Paint(sender As Object, e As PaintEventArgs) Handles MyPanel.Paint
            If ShowCircle Then
                e.Graphics.DrawEllipse(Pens.Black, New Rectangle(10, 10, 20, 20))
            End If
        End Sub

        Private Sub MyButton_Click(sender As Object, e As EventArgs) Handles MyButton.Click
            ShowCircle = True
            MyPanel.Invalidate()
        End Sub
    End Class

Just try to insert this into your code.

Why is there a boolean there?
I put a boolean there because if I don't then the circle might appear on the panel when it is first drawn(on application startup).

If you have anymore questions just start a new post.

Edited 4 Years Ago by Pride

This question has already been answered. Start a new discussion instead.