您的位置:首页 >> 编程开发 >> .NET >> 其它 >> 正文
其它 RSS
 

一个Xp风格的表单类(一)

http://www.rdxx.com 04年06月11日 12:12 Blog 我要投稿

关键词: 表单 , XP风格 , , , XP

其实是一个 无边框窗体,写成的表单类....但是外表看起来和普通的FORM完全一样.

呵呵. 最可惜的是,现在还没找到,在工具栏上放菜单的办法......哭....

下面是运行时候的图片..

我喜欢程序,更喜欢程序有个PL的界面....

但是网上似乎找不到详细的,关于此方面的教程或源码.

重绘时改用了双缓冲,在窗体上有动画的时候,重绘不会出现闪烁的现象了.

献丑一下,把源码贴出来,大家一起交流....

下面是引用,以及,声明的部分##########################################

using System;
using System.ComponentModel;
using System.Windows.Forms;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.IO;
using System.Runtime.InteropServices;
namespace XpFormOfApc
{
 /// <summary>
 /// Form1 的摘要说明。
 /// </summary>
 
 public class XpForm : System.Windows.Forms.Form
 {
  public delegate void SysHandler(object sender,System.EventArgs e);
  public event SysHandler SysDoubleClick;

        //############API设置窗口STYLE#############
  private const int GWL_STYLE = (-16);
  private const int WS_SYSMENU = 0x80000;
  private const int WS_SIZEBOX = 0x40000;
  private const int WS_MAXIMIZEBOX = 0x10000;
  private const int WS_MINIMIZEBOX=0x20000;
  [System.Runtime.InteropServices.DllImport("user32", EntryPoint="SetWindowLong")]
  private static extern int SetWindowLongA(int hwnd, int nIndex, int dwNewLong);
  //###########普通组件定义#################
  private System.ComponentModel.IContainer components;
  private System.Windows.Forms.ImageList imglist;
  private System.Windows.Forms.ImageList syslist;
  //###############组件属性##################
  //---系统按钮---
  private bool Sys_Close_Visible=true;
  private bool Sys_Max_Visible=true;
  private bool Sys_Res_Visible=false;
  private bool Sys_Min_Visible=true;
  private bool Sys_Down_Visible=false;
  private bool Sys_Up_Visible=true;
  private bool Sys_Tray_Visible=true;
  private bool IsShowInTray=false;
  private int FormIconWidth=16;
  private int FormIconHeight=16;
  private const int ONE=23;  //按钮宽21+2间隔
  private int[,] SysCmd=new int[9,7]{
                                            {1,0,7,0,6,21,21},
           {1,1,8,0,6,21,21},
           {0,2,9,0,6,21,21},
           {1,3,10,0,6,21,21},
           {0,4,11,0,6,21,21},
           {1,5,12,0,6,21,21},
           {1,6,13,0,6,21,21},
           {10,5,12,0,0,21,21},


 
 
标签: 表单 , XP风格 , , , XP 打印本文
 
 
  相关资讯
RSS
 
无相关新闻
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站