我做了一个 WinForm小的应用系统
可总觉得界面不好看 C#的界面按钮等单调,如何漂亮一些,比如象XP

解决方案 »

  1.   

    要使用XP的样式,你可以这样来实现:
    1.在Main 函数的第一行使用EnableVisualStyles方法。
    例如:
    static void Main() 
    {
         Application.EnableVisualStyles();
         Application.Run(new Form1());
    }
    2.对于支持 FlatStyle 属性的控件,请确保将 FlatStyle 属性设置为 System 
    注:此方法适用于Windows XP Home Edition、Windows XP Professional 和 Windows Server 2003
      

  2.   

    可以用图标呀!比如Button的Image属性,如果Graphics运用的好可以自己画。
    class CustomButton:System.Windows.Forms.Control
    {
         public override OnPaint(PaintEventArgs e)
         {
               //画一个宽200,高200的按钮
               Rectangle rect = new Rectangle(0,0,200,100);
               Brush blackBrush = new SolidBrush(Color.Blue);
               Graphics g = e.Graphics;
               g.FillEillpse(blackBrush,rect);
                       
         }
    }
      

  3.   

    加入manifest文件(适合所有WINDOWS应用程序)
    在执行文件相同目录中加入一个yourApplicationName.exe.manifest的XML文件,文件内容如下(加下划线片为需进行适当改变):
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> 
    <assemblyIdentity 
    version="1.0.0.0" 
    processorArchitecture="X86" 
    name="CompanyName.ProductName.YourApp" 
    type="win32" 
    /> 
    Your application description here. 
    type="win32" 
    name="Microsoft.Windows.Common-Controls" 
    version="6.0.0.0" 
    processorArchitecture="X86" 
    publicKeyToken="6595b64144ccf1df" 
    language="*" 
    /> 
    http://www.chinacs.net/archives/8/2004/11/29/3128.html
      

  4.   

    manifest仅对XP系统有效,如果要在所有的Windows版本上有同样的效果,建议还是使用第三方的控件。
      

  5.   

    我也认为:manifest仅对XP系统有效,如果要在所有的Windows版本上有同样的效果,建议还是使用第三方的控件。关注其它好办法.