string strErr;           
if (strErr != "")
{
    MessageBox.Show(this,strErr);  //this与strErr。     
return;
}就是解释一下这样写的意思!

解决方案 »

  1.   

    string strErr="";   
    if (strErr != "")
    {
      MessageBox.Show(this,strErr); //this与strErr。   
    return;
    }
    声明变量  要赋值了  不然提示错误
      

  2.   

    看看你的this是什么对象   
      

  3.   

    MessageBox.Show(IWin32Window owner,string text)
    owner
    Type: System.Windows.Forms.IWin32Window
    An implementation of IWin32Window that will own the modal dialog box. text
    Type: System.String
    The text to display in the message box. from msdn
      

  4.   

    判断是否为空,提示
    string strErr;   
    if (string.IsNullOrEmpty(strErr))
    {
      MessageBox.Show(this.strErr);  
    return;
    }
    this于引用类的当前实例,也包括继承而来的方法
      

  5.   

    strErr=""为什么是空的?strErr != "")如果strErr不等于什么?不明白,我也是新手,学习
      

  6.   

    strErr!=""就是strErr有含有字符咯
      

  7.   

    如果有字符表示为true就会执行里面的语句咯
      

  8.   

    string strErr="";   
    if (strErr != "")
    {
      MessageBox.Show(this,strErr); //this与strErr。   
    return;
    }這個是原句。當他不等于的空的時候執行下麵的語句,這我知道,我只是想问的是:
     this与strErr。为什么要这样写 this是引用当前实例,这我也知道作用是什么??、
      

  9.   

    我明白是什么意思了!调用当前实例this,进行判断。
            这个代码的意思是:如果不等于空值,那么就执行下面的代码
           所以在引用此方法的时候。 判断是否为空,为空提出提示框。恩,感谢5楼
      

  10.   

    楼主是不是要这样子提示呀   If(Str!="")
    {
        MessageBox.Show(this,Str);
      }
    大概意思是不是想 当字符串不为空的时候,弹出对话框告诉Str哈,如果你的弹出对话框是已经封装好的方法的话,我觉得你的this这个参数应该是This.Page  呵呵呵 不一定正解。。