Link to home
Start Free TrialLog in
Avatar of code_me
code_me

asked on

SCREEN FLICKERING WHEN I ADDED ICON IN WINFORM USING DRAWING IN VB.NET

my problem is
when i added icon inside
win form
using graphics

it is added successfully
but when
I run the program
the project
as well as the desktop
sceen starts to
flicker

what is the problem and how to eradicate this
please solve

i have attached the code
Private Sub frm_List_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
     
        PaintObj(e)

    End Sub
 Private Sub PaintObj(ByVal e As PaintEventArgs)
      

        Me.Icon = New System.Drawing.Icon("D:\new\Calculate\Calculate\Resources\setup.ico")
        Dim graphics As Graphics = e.Graphics

        Dim pen As New Pen(Color.Chocolate)

        graphics.DrawRectangle(pen, 10, 10, 200, 100)
        graphics.DrawLine(pen, 0, 40, 10, 100)
        graphics.DrawIcon(Icon, 30, 100)





    End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of code_me
code_me

ASKER

thanKs