Tài liệu Tiền sử lý trong C# - Pdf 86

Tiền sử lý trong C#
Chào các bác
Em có đoạn code sau em không hiểu cái từ #region cho lắm
bác nào có thể giả thích rõ hơn cho được không
nếu có tài liều hướng dẫn về cái này Port cho xin ,cái này ít thấy sách nào viết
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing.Drawing2D;
using System.Drawing;
using System.Windows.Forms;
namespace RibbonStyle
{
publicclassTabPanel : System.Windows.Forms.Panel
{
public TabPanel()
{
timer1.Interval = 1;
timer1.Tick += newEventHandler(timer1_Tick);
this.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint | ControlStyles.DoubleBuffer,
true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
}
int X0;
int XF;
int Y0;
int YF;
int T = 8;
int i_Zero = 180;
int i_Sweep = 90;
int X; int Y;

return _BaseColorOn;
}
set
{
_BaseColorOn = value;
R0 = _BaseColor.R;
B0 = _BaseColor.B;
G0 = _BaseColor.G;
}
}
publicstring Caption
{
get
{
return S_TXT;
}
set
{
S_TXT = value;
this.Refresh();
}
}
publicint Speed
{
get
{
return i_factor;
}
set
{

DrawArc3(0, 20);
e.Graphics.PageUnit = GraphicsUnit.Pixel;
Brush B4 = b4.Brush;
e.Graphics.SmoothingMode = SmoothingMode.None;
X = X0; Y = Y0; i_Zero = 180; D = 0;
e.Graphics.FillPath(b5.Brush, path);
LinearGradientBrush brocha = newLinearGradientBrush(P0, PF, b6.Color, b8.Color);
DrawArc2(15, YF - 20);
e.Graphics.FillPath(brocha, path);
DrawArc2(YF - 16, 12);
Pen bdown = newPen(Color.FromArgb(i_Op, R0 - 22, G0 - 11, B0));
e.Graphics.FillPath(bdown.Brush, path);
T = 6;
DrawArc();
DrawArc();
e.Graphics.DrawPath(b2, path);
DrawArc();
e.Graphics.DrawPath(b3, path);
Point P_EX = Cursor.Position;
P_EX = this.PointToClient(P_EX);
int ix = 10 + this.Width / 2 - S_TXT.Length * (int)this.Font.Size / 2;
PointF P_TXT = newPointF(ix, this.Height - 20);
Pen pen = newPen(this.ForeColor);
e.Graphics.DrawString(S_TXT, this.Font, pen.Brush, P_TXT);
base.OnPaint(e);
}
protectedoverridevoid OnMouseEnter(EventArgs e)
{
Point P_EX = Cursor.Position;
P_EX = this.PointToClient(P_EX);

X = X0 + 4; Y = Y0 + OF_Y; i_Zero = 180;
path = newGraphicsPath();
path.AddArc(X + D, Y + D, T, T, i_Zero, i_Sweep); i_Zero += 90; X += XF - 8;
path.AddArc(X - D, Y + D, T, T, i_Zero, i_Sweep); i_Zero += 90; Y += SW_Y;
path.AddArc(X - D, Y - D, T, T, i_Zero, i_Sweep); i_Zero += 90; X -= XF - 8;
path.AddArc(X + D, Y - D, T, T, i_Zero, i_Sweep); i_Zero += 90; Y -= SW_Y;
path.AddArc(X + D, Y + D, T, T, i_Zero, i_Sweep);
}
publicvoid DrawArc3(int OF_Y, int SW_Y)
{
X = X0; Y = Y0 + OF_Y; i_Zero = 180;
path = newGraphicsPath();
path.AddArc(X + D, Y + D, T, T, i_Zero, i_Sweep); i_Zero += 90; X += XF;
path.AddArc(X - D, Y + D, T, T, i_Zero, i_Sweep); i_Zero += 90; Y += SW_Y;
path.AddArc(X - D, Y - D, T, T, i_Zero, i_Sweep); i_Zero += 90; X -= XF;
path.AddArc(X + D, Y - D, T, T, i_Zero, i_Sweep); i_Zero += 90; Y -= SW_Y;
path.AddArc(X + D, Y + D, T, T, i_Zero, i_Sweep);
}
privateTimer timer1 = newTimer();
void timer1_Tick(object sender, EventArgs e)
{
#region Entering
if (i_mode == 0)
{
if (System.Math.Abs(_BaseColorOn.R - R0) > i_factor)
{ i_fR = i_factor; }
else { i_fR = 1; }
if (System.Math.Abs(_BaseColorOn.G - G0) > i_factor)
{ i_fG = i_factor; }
else { i_fG = 1; }

}
else
{
this.Refresh();
}
}
#endregion
#region Leaving
if (i_mode == 1)
{
if (System.Math.Abs(_BaseColor.R - R0) < i_factor)
{ i_fR = 1; }
else { i_fR = i_factor; }
if (System.Math.Abs(_BaseColor.G - G0) < i_factor)
{ i_fG = 1; }
else { i_fG = i_factor; }
if (System.Math.Abs(_BaseColor.B - B0) < i_factor)
{ i_fB = 1; }
else { i_fB = i_factor; }
if (_BaseColor.R < R0)
{
R0 -= i_fR;
}
elseif (_BaseColor.R > R0)
{
R0 += i_fR;
}
if (_BaseColor.G < G0)
{
G0 -= i_fG;


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status