ControlStyles.ContainerControl,true);
}
protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
{
//base.OnPaint(e);
this.RePaint();
base.OnPaint(e);
//ee=e;
}
protected override void OnResize(System.EventArgs e)
{
Rectangle r=Screen.GetWorkingArea(this);
this.MaximumSize=new Size(r.Width,r.Height);
if(this.WindowState==FormWindowState.Maximized)
{
if(Sys_Max_Visible==true)
{
Sys_Max_Visible=false;
Sys_Res_Visible=true;
}
if(Sys_Up_Visible==true)
{
Sys_Up_Visible=false;
CanUp=1;
}
}
if(this.WindowState==FormWindowState.Normal)
{
if(Sys_Res_Visible==true)
{
Sys_Max_Visible=true;
Sys_Res_Visible=false;
}
if(CanUp==1)
{
Sys_Up_Visible=true;
CanUp=0;
}
}
this.RePaint();
//this.OnPaint(ee);
ReCreateRegion();
this.Refresh();
}
protected override void OnMouseMove(System.Windows.Forms.MouseEventArgs e)
{
if(CanMove==true)
{
//this.Cursor=Cursors.SizeAll;
//this.Top=Cursor.Position.Y-CurPoint.Y;
//this.Left=Cursor.Position.X-CurPoint.X;
if(CurPoint.X>SysCmd[8,3] && CurPoint.X<SysCmd[8,5] && CurPoint.Y<30 && (Sys_Res_Visible!=true ))
{
ReleaseCapture();
SendMessage(this.Handle,WM_SYSCOMMAND,SC_MOVE+HTCAPTION, 0);
}
}
Graphics g=this.CreateGraphics();
for(int i=0;i<=6;i++)
{
if(SysCmd[i,0]==1)
{
if(e.X>SysCmd[i,3] && e.X<SysCmd[i,3]+21 && e.Y>6 && e.Y<27)
{g.DrawImage(syslist.Images[SysCmd[i,2]],SysCmd[i,3],6,21,21);}
else{g.DrawImage(syslist.Images[SysCmd[i,1]],SysCmd[i,3],6,21,21);}
}
}
g.Dispose();
CurPoint2.X=Cursor.Position.X-this.Left;
CurPoint2.Y=Cursor.Position.Y-this.Top;
}
protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
{
if(e.Button==MouseButtons.Left && e.X>SysCmd[8,3] && e.X<SysCmd[8,5] && e.Y<30)
{
CanMove=true;
}
CurPoint.X=e.X;
CurPoint.Y=e.Y;
}
protected override void OnMouseUp(System.Windows.Forms.MouseEventArgs e)
{
//if(e.Button==MouseButtons.Left && e.X>SysCmd[8,3] && e.X<SysCmd[8,5] && e.Y<30)
//{
CanMove=false;
this.Cursor=Cursors.Default;
//}
}
protected override void OnClick(System.EventArgs e)
{
for(int i=0;i<=6;i++)
{
if(SysCmd[i,0]==1)
{
if(CurPoint.X>SysCmd[i,3] && CurPoint.X<SysCmd[i,3]+21 && CurPoint.Y>6 && CurPoint.Y<27)
{DoClick(i);}
else{}
}
}
}
protected override void OnDoubleClick(System.EventArgs e)
{
if(CurPoint.X>SysCmd[8,3] && CurPoint.X<SysCmd[8,5] && CurPoint.Y<30 && (Sys_Max_Visible==true(北联网教程,专业提供视频软件下载)
……