Private Sub Command1_Click() 
Image1.Visible = Not (Image1.Visible) 
Image2.Visible = Not (Image2.Visible) 
End Sub

解决方案 »

  1.   

    if (this.pictureBox1.Visible == true) 

    this.pictureBox1.Visible = false; 
    this.pictureBox2.Visible = true; 

    else if (this.pictureBox1.Visible == false) 

    this.pictureBox1.Visible = true; 
    this.pictureBox2.Visible = false;
    }
      

  2.   

    你用的是ImageButton?
    先定义一个变量,onclick后首先判断这个值是否为空,若为空就给这个变量赋一个值,并把图片换上.若不为空又给按钮换上另一张图片...
    我的思路是这样的....
      

  3.   

    C#中有ImageButton么。。我的好像没有
      

  4.   

    http://www.panoramio.com/photos/square/4637525.jpg  
      楼上看看这个~~~
      

  5.   

      protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                GetImageUrl(ImageButton1, new string[] { "mian_14.gif", "mian_15.gif" }, 0);
            }
            
        }    public static void GetImageUrl(ImageButton btn, string[] url, int i)
        {
            if (i.Equals(0))
                btn.ImageUrl = url[0];
            else
                btn.ImageUrl = url[1];
        }    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            GetImageUrl(ImageButton1, new string[] { "mian_14.gif", "mian_15.gif" }, 1);
        }
      

  6.   

    写一个 JS 用来改变 button 的 style