if(MessageBox.Show("你的输出信息","你的标题信息",MessageBoxButtons.YesNo,MessageBoxIcon.Question)==DialogResult.Yes)
{
MessageBox.Show("你回应的是---Yes","返回信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}
else
{
MessageBox.Show("你回应的是---No","返回信息",MessageBoxButtons.OK,MessageBoxIcon.Information);
}

解决方案 »

  1.   

    请问要调用什么命名空间?
    我试过用using System.Windows.Forms;调试时显示:
    类型或命名空间名称“Windows”在类或命名空间“System”中不存在(是否缺少程序集引用?)
      

  2.   

    你写的什么程序,Application还是Dll,或者其他什么?
      

  3.   

    我写的是web窗体,后缀是.aspx
    是不是不能用messagebox?我该怎么样解决问题?
      

  4.   

    那当然了,嵌入一小段java来做这方面的事。
      

  5.   

    在datagrid 的ItemCreated事件
    ListItemType listtype=e.Item.ItemType;
    if ((listtype==ListItemType.Item)||(listtype==ListItemType.AlternatingItem)||(listtype==ListItemType.EditItem))
    {
    TableCell myTableCell = new TableCell();
    myTableCell = e.Item.Cells[13];  //删除按钮所在列
    LinkButton myDeleteButton = new LinkButton();
    myDeleteButton = (LinkButton)myTableCell.Controls[0];
    myDeleteButton.Attributes.Add("onclick","return confirm('确实要删除当前行记录吗?');"); }
      

  6.   

    如果你是写Web 程序,那么你应该用javascript
    Document.Alert()
      

  7.   

    working1997(haha) 大哥:
    你的方法能不能讲详细一点,我刚学习.net的。谢谢~~~
      

  8.   

    1.在grid 中加入按钮列--删除,列号为 1 吧(不定的)
    2.其实在你点击此删除按钮时,执行两个事件,先是grid的ItemCreated,再是DeleteCommand
    3.把上面的程序放到你的grid的ItemCreated中,主要要修改的地方就是你的删除列的列号,再在你grid的DeleteCommand中执行你确认要删除的语句(这个要自己写哦)
    不知道上面说的你清楚了没?其实我也是刚接触.net没多久,一块学习吧!
      

  9.   

    每次给DataGrid绑定数据的时候:
    dataGrid.DataSource = dataSet.Tables["MyTable"].DefaultView;
    dataGrid.DataBind();
    foreach(DataGridItem item in dataGrid.Items)
    {
          ((LinkButton)item.Cells[columnIndex].Controls[0]).Attributes.Add("onClick",
    "return confirm('Are you sure to delete?');");
    }
    // columnIndex is the index of the column
      

  10.   

    working1997大哥:
    按你的方法成功了,我还想继续做一下改进
    现在的弹出对话框标题是“micsoft internet exploer”,我想改变标题的文字,可以做到吗?