用C#的窗体程序,用butten按钮控制图片旋转
butten控制图片的旋转同时窗体的颜色有红变蓝butten每按一下窗体变下颜色(在红,蓝间转换)...
butten控制图片的旋转 同时窗体的颜色有红变蓝butten每按一下 窗体变下颜色(在红,蓝间转换)
展开
2个回答
2013-11-19
展开全部
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;namespace werty
{ public partial class MainForm
{
int sum=1;
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
InitializeComponent();
}
void Button1Click(object sender, System.EventArgs e)
{
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipXY);
if(sum%2==0)
{
this.BackColor=Color.Red ;
}
else
{
this.BackColor =Color.Blue;
}
this.Refresh();
sum=sum+1;
}
void MainFormLoad(object sender, System.EventArgs e)
{
}
void Button3Click(object sender, System.EventArgs e)
{
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate270FlipXY);
if(sum%2==0)
{
this.BackColor =Color.Blue ;
}
else
{
this.BackColor =Color.Red ;
}
this.Refresh();
sum=sum+1;
}
}
}
希望对你有所帮助 。。。。。
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;namespace werty
{ public partial class MainForm
{
int sum=1;
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
public MainForm()
{
InitializeComponent();
}
void Button1Click(object sender, System.EventArgs e)
{
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate90FlipXY);
if(sum%2==0)
{
this.BackColor=Color.Red ;
}
else
{
this.BackColor =Color.Blue;
}
this.Refresh();
sum=sum+1;
}
void MainFormLoad(object sender, System.EventArgs e)
{
}
void Button3Click(object sender, System.EventArgs e)
{
pictureBox1.Image.RotateFlip(RotateFlipType.Rotate270FlipXY);
if(sum%2==0)
{
this.BackColor =Color.Blue ;
}
else
{
this.BackColor =Color.Red ;
}
this.Refresh();
sum=sum+1;
}
}
}
希望对你有所帮助 。。。。。
2013-11-19
展开全部
在butten单击事件里面设置窗体的背景颜色啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询