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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.