好的,在我的程序中,我顯示了一個printDialog,並且想要知道用戶是否單擊了打印按鈕或取消按鈕。在我看到的所有在線示例中,printDialog都有OK按鈕,而不是Print按鈕。 爲例(代碼從MSDN): System::Windows::Forms::DialogResult result = printDialog1->ShowDialog();
if (result == ::Di
private void mnuCustomerAdd_Click(object sender, EventArgs e)
{
CustomerForm frmCust = new CustomerForm("Add A New Customer");
int index = lstCustomers.SelectedIndex;
if (index
我有一個C#GUI應用程序。當用戶點擊紅色'X'(關閉應用程序)時,我想顯示一條消息並詢問他是否真的想關閉它。 我找到了一個解決方案: DialogResult dialog = MessageBox.Show("Do you really want to close the program?", "SomeTitle", MessageBoxButtons.YesNo);
if (
我試圖讓用戶確認他們是否想要使用MessageBox刪除產品並捕獲其結果。這是我的代碼: // Confirm if the user really wants to delete the product
DialogResult result = MessageBox.Show("Do you really want to delete the product \"" + productNam
我有一個簡單的確定/取消DialogResult例如: MessageBox.Show("Number of records affected:" + numberOfRecordsroll + " Please check the data is correct before proceeding:", "Please validate your changes", MessageBoxButt
在下面的代碼我想獲得一個窗體的對話框結果,但它沒有保存到我的變量...爲什麼? 我的代碼: public void xyz() {
var dialogResult = new DialogResult();
if (booleanVariable) {
var form1 = new Form1();
form1.ShowDialog();