//新建一个Windwos窗体项目, 从工具箱拉两个RadioButton, 一个PictureBox,
//还有一个ImageList到窗体上,把两张图片加入到imagelist中;
//选中两个RadioButton控件(一定要一起选中), 找到Click事件, 点击一下进入代码
//其它的你看我以下的就好了.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication3 //此处你修改成你自己的命名空间
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
pictureBox1.Image = imageList1.Images[0];
}
private void radioButton1_Click(object sender, EventArgs e)
{
if (((RadioButton)sender).Name.ToString() == "radioButton1")
{
pictureBox1.Image = imageList1.Images[0];
}
else
{
pictureBox1.Image = imageList1.Images[1];
}
}
}
}