PaintEventArgs.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
    protected virtual void Dispose(bool disposing)
    {
        if (disposing && graphics != null)
            graphics.Dispose ();
    }

Same methods

PaintEventArgs::Dispose ( ) : void

Usage Example

Beispiel #1
0
        private void UserSetPassword_Paint(object sender, PaintEventArgs e)
        {
            if (!textBoxPassword.Text.Equals(textBoxVerifyPassword.Text))
            {
                if (iconHit)
                {
                    toolTip1.SetToolTip(this, "Passwords do not match!");
                }

                toggle = !toggle;
                if (toggle)
                {
                    e.Graphics.DrawIcon(warn, iconPoint.X, iconPoint.Y);
                }
                else
                {
                    e.Graphics.DrawIcon(blank, iconPoint.X, iconPoint.Y);
                }
                e.Dispose();
                timer1.Start();
            }
            else
            {
                toolTip1.SetToolTip(textBoxVerifyPassword, "");
                e.Graphics.DrawIcon(blank, iconPoint.X, iconPoint.Y);
                e.Dispose();
                timer1.Stop();
            }
        }
All Usage Examples Of PaintEventArgs::Dispose