c#界面怎么美化 想做成如下效果:界面的背景色是渐变的 而不是固定某种颜色的 比如从上到下是从浅蓝变到蓝占用别人的时间不太道德 只求一种解决思路就满足啦~~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 很简单的,我给你一个提示,如果不明白可以问我:在窗体point事件中进行绘图:实现渐变的色彩,有一个非常有用的类:TextTrueBrush类 还是引用一些皮肤控件吧 如果真想做的那么美轮美奂 建议你学习WPF 主意好,可是自己就是美工 还是码农 还是项目经理 还是老板 还是CEO这么一想心里就痛快了!!! 用代码实现渐变还是挺麻烦的,但是用photoshop就易如反掌! 用PNG格式图片,属性设为struct protected override void OnPaintBackground(PaintEventArgs e){ base.OnPaintBackground(e); using (LinearGradientBrush brush = new LinearGradientBrush(e.ClipRectangle, Color.Beige, Color.Red, LinearGradientMode.Vertical)) { e.Graphics.FillRectangle(brush, e.ClipRectangle); }} http://ufo-crackerx.blog.163.com/blog/static/11307877820122141122808/ 调用这个IrisSkin具体的去CSDN中看 IrisSkin 是垃圾的,很多bug Winform的界面美化真是蛋疼,可能的话还是用WPF做吧。 private void Form1_Paint(object sender, PaintEventArgs e) { //这个类是创建线性渐变颜色,具体怎么用,你看看他的构造函数就明白了 //用这个类需要添加命名空间:using System.Drawing.Drawing2D; LinearGradientBrush line = new LinearGradientBrush(new Point(0,0),new Point(300,300), Color.Green,Color.Red); Graphics gra = e.Graphics; //我在这里画了一个圆,然后用刚才创建的那个线性渐变的对象来填充他。 gra.FillEllipse(line,new Rectangle(new Point(0,0),new Size(300,300))); }另外还有一个思路,就是用一个渐变的图片来填充,这个时候你可以用texttruebrush类 个人认为画背景最好不要放在 Paint 事件里面去做,放在提前触发的 OnPaintBackgroud 里面去做。LinearGradientBrush 需要 Dispose。 LinearGradientBrush line = new LinearGradientBrush(new Point(0,0),new Point(300,300), Color.Green,Color.Red);Graphics gra = e.Graphics; WPF UI控件 上面的一些朋友的看法很赞同,比如你可以使用POINT进行操作,以及使用皮肤空间等! 这个有段时间没有搞.NET了! 再來一個輕量級的http://ufo-crackerx.blog.163.com/blog/static/113078778201221941343153/ c# 仿Foxmail换肤功能源码 http://download.csdn.net/detail/tebiefu/4145731 All SkinSoft products 如果你不想让你的界面反应缓慢的话,就用onpaint吧。当然,我想你的内存大到足够放得下你的背景大小的图片。 c#正则 文件怎么读写System.io C#怎么读写数据库 sql 类 网络视频技术 线程问题+ActiveX问题+2005(我也搞不清楚是什么问题) 关于HttpWebResponse cookie的问题 50分求VS.NET2003的MSDN下载 怎样创建Socket的长连接? 关于不同窗体间的传值问题 数据库读取的string类型的Html如何还原成Html 运行signtool signwizard 为什么没有出现数字签名向导界面?
在窗体point事件中进行绘图:实现渐变的色彩,有一个非常有用的类:TextTrueBrush类
主意好,可是自己就是美工 还是码农 还是项目经理 还是老板 还是CEO这么一想心里就痛快了!!!
protected override void OnPaintBackground(PaintEventArgs e)
{
base.OnPaintBackground(e); using (LinearGradientBrush brush = new LinearGradientBrush(e.ClipRectangle, Color.Beige, Color.Red, LinearGradientMode.Vertical))
{
e.Graphics.FillRectangle(brush, e.ClipRectangle);
}
}
具体的去CSDN中看
private void Form1_Paint(object sender, PaintEventArgs e)
{
//这个类是创建线性渐变颜色,具体怎么用,你看看他的构造函数就明白了
//用这个类需要添加命名空间:using System.Drawing.Drawing2D;
LinearGradientBrush line = new LinearGradientBrush(new Point(0,0),new Point(300,300), Color.Green,Color.Red);
Graphics gra = e.Graphics; //我在这里画了一个圆,然后用刚才创建的那个线性渐变的对象来填充他。
gra.FillEllipse(line,new Rectangle(new Point(0,0),new Size(300,300)));
}
另外还有一个思路,就是用一个渐变的图片来填充,这个时候你可以用texttruebrush类
个人认为画背景最好不要放在 Paint 事件里面去做,放在提前触发的 OnPaintBackgroud 里面去做。LinearGradientBrush 需要 Dispose。
Graphics gra = e.Graphics;
这个有段时间没有搞.NET了!