public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
public class ImageButton : Control
{
public Image Image
{
get ;
set ;
}
private Bitmap m_bmpOffscreen;
public ImageButton()
{
this .Size = new Size(21, 21);
}
protected override void OnPaint(PaintEventArgs e)
{
try
{
if ( this .Image != null )
{
Graphics gxOff; //Offscreen graphics
if (m_bmpOffscreen == null ) //Bitmap for doublebuffering
{
m_bmpOffscreen = new Bitmap (ClientSize.Width, ClientSize.Height);
}
gxOff = Graphics .FromImage(m_bmpOffscreen);
//gxOff.Clear(this.BackColor);
//Draw some bitmap
gxOff.DrawImage( this .Image, 0, 0, this .ClientRectangle, GraphicsUnit.Pixel);
//Boundary rectangle
Rectangle rc = this .ClientRectangle;
rc.Width--;
rc.Height--;
//Draw boundary
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
//Draw from the memory bitmap
e. Graphics .DrawImage(m_bmpOffscreen, 0, 0);
gxOff.Dispose();
}
}
catch (Exception ex)
{
}
}
private Color BackgroundImageColor(Image image)
{
Bitmap bmp = new Bitmap (image);
return bmp.GetPixel(0, 0);
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
}
protected override void OnPaintBackground(PaintEventArgs e)
{
//Do nothing
}
}
* This source code was highlighted with Source Code Highlighter .
double buffering, ImageButton .
, - focused. - . :
OnPaint :
gxOff.DrawRectangle( new Pen(Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
:
gxOff.DrawRectangle( new Pen(( this .Focused) ? Color.Black : Color.Transparent), rc);
* This source code was highlighted with Source Code Highlighter .
OnGotFocus OnLostFocus, Invalidate :
protected override void OnGotFocus( EventArgs e)
{
base .OnGotFocus(e);
this .Invalidate();
}
protected override void OnLostFocus( EventArgs e)
{
base .OnLostFocus(e);
this .Invalidate();
}
* This source code was highlighted with Source Code Highlighter .
Focused , - . . , , , .
PS , .
Source: https://habr.com/ru/post/66788/
All Articles