你想做什么?
调用前设定一个变量的值为false
在方法最后设定一个变量的值为true
返回后
判断变量的值是否被修改可以吗?

解决方案 »

  1.   

    我用了一个静态变量!public static int Button_Do=0;但是结果是没有用!
    private void Button4_Click(object sender, System.EventArgs e)
    {
        Button_Do=1;
    PagerButtonClick(Button4.CommandArgument.ToString());
    }
    然后再在
    if(Button_Do==1)
    {
      Button_Do=0;
    }
    else
    {
       GotoPage.Text=Convert.ToString(DataGrid1.CurrentPageIndex+1);
    }
    我看了运行过程,它是做了Button_Do=0;但是没有我想要的结果!是不是不可以这样设变量啊!