• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# DialogResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中DialogResult的典型用法代码示例。如果您正苦于以下问题:C# DialogResult类的具体用法?C# DialogResult怎么用?C# DialogResult使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DialogResult类属于命名空间,在下文中一共展示了DialogResult类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BtnSave_Click

        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (!String.IsNullOrEmpty(textBox.Text))
            {
                DialogResult dr = new DialogResult();
                ConfirmDialogView confirm = new ConfirmDialogView();
                confirm.getLabelConfirm().Text = "Weet u zeker dat u de naam van de vragenlijst wilt wijzigen?";
                dr = confirm.ShowDialog();

                if (dr == DialogResult.Yes)
                {
                    Model.QuestionList questionList = new Model.QuestionList();
                    questionList.Id = QuestionListId;
                    questionList.Name = textBox.Text;
                    Controller.UpdateQuestionList(questionList);

                    this.QuestionListNameChanged = true;
                    confirm.Close();
                }
            }
            else
            {
                MessageBox.Show("U heeft niks ingevuld, vul alstublieft de nieuwe naam in");
            }
        }
开发者ID:1337Steven1337,项目名称:KBS2G3,代码行数:25,代码来源:RenameQuestionList.cs


示例2: btnSlipOrReport_Click

 private void btnSlipOrReport_Click(object sender, EventArgs e)
 {
     this.Hide();
     DialogResult dr = new DialogResult();
     SalarySlip ss = new SalarySlip();
     dr = ss.ShowDialog();
 }
开发者ID:shivam01990,项目名称:Human-Resource-Management-System-windows-Application,代码行数:7,代码来源:SearchSalaryDetails.cs


示例3: brisiDioNekretnineButton_Click

        private void brisiDioNekretnineButton_Click(object sender, EventArgs e)
        {
            try
            {
                DAO dao = new DAO("localhost", "ikzavrsni", "root", "root");

                for (int i = 0; i < dijeloviNekretnineListView.Items.Count; i++)
                    if (dijeloviNekretnineListView.Items[i].Selected == true)
                    {
                        foreach (DioNekretnine dn in dijeloviNekretnina)
                            if (dn.Naziv == dijeloviNekretnineListView.Items[i].Text)
                            {
                                DialogResult dr = new DialogResult();
                                dr = MessageBox.Show("Da li ste sigurni da želite izbrisati odabrani dio nekretnine iz baze podataka?", "Upozorenje", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

                                if (dr == System.Windows.Forms.DialogResult.Yes)
                                {
                                    dao.IzbrisiDioNekretnine(dn.Sifra);
                                    dijeloviNekretnineListView.Items.Clear();
                                    statusStrip1.BackColor = Color.White;
                                    toolStripStatusLabel1.ForeColor = Color.Green;
                                    toolStripStatusLabel1.Text = "Uspješno izbrisani podaci.";
                                    return;
                                }
                            }
                    }
            }
            catch (Exception)
            {
                statusStrip1.BackColor = Color.White;
                toolStripStatusLabel1.ForeColor = Color.Red;
                toolStripStatusLabel1.Text = "Podaci nisu obrisani!";
            }
        }
开发者ID:ik15151,项目名称:etf-2013-bsc-zr,代码行数:34,代码来源:PregledNekretnina.cs


示例4: DGProduct_UserDeletingRow

        private void DGProduct_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
        {
            if (countDeleting == 1)
            {
                dialogResult = MessageBox.Show("Esta seguro que desea eliminar los productos seleccionados?\r\n" + DGProduct.SelectedRows.Count + " productos seran eliminados!", "Eliminar productos", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
                countSelectedRows = DGProduct.SelectedRows.Count;
            }

            if (countDeleting == countSelectedRows)
            {
                countDeleting = 1;
                countSelectedRows = 0;
            }
            else
                countDeleting++;

            if (dialogResult == DialogResult.Cancel)
                e.Cancel = true;
            else
            {
                try {
                    int id = Int32.Parse(e.Row.Cells["Id"].Value.ToString());
                    Product prod = stock.Product.First(i => i.id == id);
                    prod.deleted_at = DateTime.Now;
                    stock.SaveChanges();

                }catch(Exception exc)
                {
                    Console.WriteLine(exc);
                }
                finally {
                    e.Cancel = false;
                }
            }
        }
开发者ID:tinchotricolor22,项目名称:Control-de-Stock,代码行数:35,代码来源:FormProduct.cs


示例5: SetInfomation

 public void SetInfomation(DialogResult _result, int _textId, Vector3 _location)
 {
     tranformBtn.gameObject.SetActive(true);
     result = _result;
     //text.text = AvLocalizationManager.GetString(_textId);
     tranformBtn.localPosition = _location;
 }
开发者ID:BGCX262,项目名称:zzzstrawhatzzz-svn-to-git,代码行数:7,代码来源:GUIMessageDialog.cs


示例6: SendDialogManagerMessage

    public const string DIALOG_RESULT = "DialogResult"; // Type: DialogResult

    public static void SendDialogManagerMessage(Guid dialogHandle, DialogResult result)
    {
      SystemMessage msg = new SystemMessage(MessageType.DialogClosed);
      msg.MessageData[DIALOG_HANDLE] = dialogHandle;
      msg.MessageData[DIALOG_RESULT] = result;
      ServiceRegistration.Get<IMessageBroker>().Send(CHANNEL, msg);
    }
开发者ID:chekiI,项目名称:MediaPortal-2,代码行数:9,代码来源:DialogManagerMessaging.cs


示例7: CloseThis

				void CloseThis(DialogResult result= System.Windows.Forms.DialogResult.OK)
				{
					if (Loading)
						return;
					this.DialogResult = result;
					this.Close();
				}
开发者ID:robotsrulz,项目名称:Sardauscan,代码行数:7,代码来源:GLViewerConfigForm.cs


示例8: CreatePerson

 public void CreatePerson(Packet templatePacket = null)
 {
     FormMode = Mode.Create;
     saveDialogResult = DialogResult.None;
     btnClose.Visible = true;
     _templatePacket = templatePacket;
 }
开发者ID:AndyLem,项目名称:VisaCzech,代码行数:7,代码来源:PersonForm.cs


示例9: AddAction

    public void AddAction(string text, DialogResult result, Image image = null, bool isDefault = false)
    {
      int width = this.ClientSize.Width-20;
      var button = new SimpleButton();
      button.Text = text;
      button.Appearance.TextOptions.HAlignment = HorzAlignment.Near;
      button.Image = image;
      button.Width = width;
      button.Left = 10;
      button.Height = ButtonHeight;
      button.Anchor = AnchorStyles.Left | AnchorStyles.Top | AnchorStyles.Right;
      button.Tag = result;
      button.Click += button_Click;
      
      this.Controls.Add(button);

      if (isDefault)
        this.AcceptButton = button;

      button.DialogResult = result;
      if (result == DialogResult.Cancel)
      {
        this.CancelButton = button;
        this.ControlBox = true;
        this.SelectedAction = result;
      }
    }
开发者ID:CIHANGIRCAN,项目名称:ChanSort,代码行数:27,代码来源:ActionBox.cs


示例10: HandleResult

        /// <summary>
        /// <para>If DPAPI settings change, this saves the key algorithm out with the new settings.</para>
        /// </summary>
        /// <param name="dialogResult">
        /// <para>One of the <see cref="DialogResult"/> values.</para>
        /// </param>
        /// <param name="originalSettings">
        /// <para>The original <see cref="DpapiSettings"/> before editing.</para>
        /// </param>
        /// <param name="newSettingsData">
        /// <para>The new <see cref="DpapiSettingsData"/> from the editor.</para>
        /// </param>
        /// <returns>
        /// <para>If accepted, the new <see cref="DpapiSettings"/>; otherwise the <paramref name="originalSettings"/>.</para>
        /// </returns>
        protected override object HandleResult(DialogResult dialogResult, DpapiSettings originalSettings, DpapiSettingsData newSettingsData)
        {
            bool returnBaseResult = true;

            if (dialogResult == DialogResult.OK)
            {
                DpapiSettings newDpapiSettings = null;
                if (newSettingsData != null)
                {
                    newDpapiSettings = new DpapiSettings(newSettingsData);
                }

                if (newDpapiSettings != originalSettings)
                {
                    returnBaseResult = SaveKeyAlgorithmPairWithNewDapiSettings(newDpapiSettings, originalSettings);
                }
            }

            if (returnBaseResult)
            {
                return base.HandleResult(dialogResult, originalSettings, newSettingsData);
            }
            else
            {
                return originalSettings;
            }
        }
开发者ID:bnantz,项目名称:NCS-V1-1,代码行数:42,代码来源:FileKeyAlgorithmDpapiSettingsEditor.cs


示例11: ShowInputDialog

 /// <summary>
 /// Ввод значения из модального диалога
 /// </summary>
 /// <param name="caption">заголовок окна диалога</param>
 /// <param name="label">надпись в окне слева от поля ввода</param>
 /// <param name="enableCancel">видимость кнопки "Отмена"</param>
 /// <param name="inputText">начальное значение</param>
 /// <param name="rst">DialogResult.OK - нажата кнопка "Принять", DialogResult.Cancel - нажата кнопка "Отмена"</param>
 /// <returns></returns>
 public static string ShowInputDialog(string caption, string label,
     bool enableCancel, string inputText, out DialogResult rst)
 {
     var dlg = new SimpleDialog(caption, label, enableCancel, inputText);
     rst = dlg.ShowDialog();
     return dlg.InputValue;
 }
开发者ID:johnmensen,项目名称:TradeSharp,代码行数:16,代码来源:Dialogs.cs


示例12: btnAddProfile_Click

        private void btnAddProfile_Click(object sender, EventArgs e)
        {
            // Make sure the email is valid
            if (SGGlobals.IsEmailValid(txtDefaultAddress.Text) == false)
            {
                MessageBox.Show("Email address does not appear to be valid!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }

            // Make sure the profile doesn't exist
            try
            {
                UserProfiles.GetProfileByName(txtProfileName.Text);

                // Profile exists!
                MessageBox.Show("Profile name already exists!", "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return;
            }
            catch (ProfileNotFoundException)
            {
                // Profile does not exist, create it
                Profile objNewProfile = new Profile();
                objNewProfile.Name = txtProfileName.Text;
                objNewProfile.ToAddresses.Add(txtDefaultAddress.Text);
                objNewProfile.Save();
                this._objDialogStatus = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show("An unknown error occured creating the new profile:"
                    + Environment.NewLine + ex.Message, "Error creating profile", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
开发者ID:s0lt4r,项目名称:spamgrabber,代码行数:34,代码来源:frmNewProfile.cs


示例13: button1_Click

 private void button1_Click(object sender, EventArgs e)
 {
     SaveFileDialog sfd = new SaveFileDialog();
        sfd.AddExtension = true;
        sfd.DefaultExt = ".h";
        sfd.FileName = "os_cfg";
        DialogResult dr = new DialogResult();
        dr=sfd.ShowDialog();
        if (dr == DialogResult.OK)
        {
         String directory = @sfd.FileName;
         String text = textBox1.Text;
         if (File.Exists(directory))
         {
             StreamWriter swWriter = new StreamWriter(directory);
             swWriter.WriteLine(text);
             swWriter.Flush();
             swWriter.Close();
         }
         else
         {
             FileStream fs = File.Create(directory);
             fs.Flush();
             fs.Close();
             StreamWriter swWriter = new StreamWriter(directory);
             swWriter.WriteLine(text);
             swWriter.Flush();
             swWriter.Close();
         }
        }
 }
开发者ID:ZhanNeo,项目名称:test,代码行数:31,代码来源:Form1.cs


示例14: SettingsDlg_FormClosing

        private void SettingsDlg_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (uidBox.Focused && uidBox.Text != HatHConfig.UserID)
            {
                HatHConfig.UserID = uidBox.Text;
                exitWith = DialogResult.OK;
            }

            if (passBox.Focused && passBox.Text != HatHConfig.PassHash)
            {
                HatHConfig.PassHash = passBox.Text;
                exitWith = DialogResult.OK;
            }

            if (hathrootBox.Focused && hathrootBox.Text != HatHConfig.HatHRoot)
            {
                HatHConfig.HatHRoot = hathrootBox.Text;
                exitWith = DialogResult.OK;
            }

            if (outdirBox.Focused && outdirBox.Text != HatHConfig.OutputDirectory)
            {
                HatHConfig.OutputDirectory = outdirBox.Text;
                exitWith = DialogResult.OK;
            }

            DialogResult = exitWith;
        }
开发者ID:p1nkc0de,项目名称:hathCacheRipper,代码行数:28,代码来源:SettingsDlg.cs


示例15: OnRunStarted

        /// <summary>
        /// Runs custom wizard logic at the beginning of a template wizard run.
        /// </summary>
        protected override void OnRunStarted()
        {
            TraceService.WriteLine("WebRequestServiceWizard::OnRunStarted");

            WebRequestServiceView view = new WebRequestServiceView();
            view.ShowDialog();

            this.dialogResult = view.DialogResult;

            if (this.dialogResult == DialogResult.OK)
            {
                this.entityName = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(view.EntityName);

                this.ReplacementsDictionary.Add("$webRequestEntityName$", this.entityName);

                this.AddGlobal("MockWebRequestService", "mock" + this.entityName + "WebRequestService");
                this.AddGlobal("InterfaceWebRequest", "I" + this.entityName + "WebRequestService");
                this.AddGlobal("webRequestInstance", this.entityName.LowerCaseFirstCharacter() + "WebRequestService");
                this.AddGlobal("WebRequestService", this.entityName + "WebRequestService");

                this.AddGlobal("SampleWebRequestService", this.entityName + "WebRequestService");

                this.AddGlobal("SampleWebRequestData", this.entityName);
                this.AddGlobal("WebRequestSampleData", this.entityName);

                this.AddGlobal("SampleWebRequestDataInstance", this.entityName.LowerCaseFirstCharacter());
                this.AddGlobal("SampleWebRequestTranslator", this.entityName + "Translator");
            }
        }
开发者ID:rmarinho,项目名称:NinjaCoderForMvvmCross,代码行数:32,代码来源:WebRequestServiceWizard.cs


示例16: m_cmd_xoa_Click

        private void m_cmd_xoa_Click(object sender, EventArgs e)
        {
            try
            {
                //lay ra du lieu cua dong muon xoa bang thay da bam vao
                DataRow v_dr = m_grv.GetDataRow(m_grv.FocusedRowHandle);
                // lay ra id cua dong du lieu vua chon gan vao v_id duoi dang chuoi
                decimal v_id = CIPConvert.ToDecimal(v_dr["ID"].ToString());

                US_DM_CAU_HOI v_us = new US_DM_CAU_HOI(v_id);

                DialogResult result = new DialogResult();
                result = MessageBox.Show("Bạn chắc chắn muốn xóa?","Xác nhận", MessageBoxButtons.YesNo,MessageBoxIcon.Question,MessageBoxDefaultButton.Button2);

                if (result == DialogResult.Yes)
                {
                    v_us.Delete();
                    MessageBox.Show("Bạn vừa xóa thành công");
                    load_data_2_grid();
                }
            }
            catch (Exception v_ex)
            {
                CSystemLog_301.ExceptionHandle(v_ex);
            }
        }
开发者ID:anhphamkstn,项目名称:DVMC,代码行数:26,代码来源:Form1.cs


示例17: CommonExport

        public void CommonExport()
        {
            DialogResult result = new DialogResult();
            SaveFileDialog dialog = new SaveFileDialog();
            dialog.RestoreDirectory = false;
            dialog.Filter = "PNG Image (*.png) [Recommended]|*.png|JPEG Image (*.jpeg) [Bad Idea]|*.jpg|BMP Image (*.bmp)|*.bmp";
            dialog.FileName = Path.ChangeExtension(filename, null);
            dialog.AddExtension = true;
            result = dialog.ShowDialog();
            if (dialog.FileName != "" && result == DialogResult.OK)
            {
                System.IO.FileStream fs = (System.IO.FileStream)dialog.OpenFile();
                switch (dialog.FilterIndex)
                {
                    case 1:
                        bitmap.Save(fs,
                        System.Drawing.Imaging.ImageFormat.Png);
                        break;

                    case 2:
                        bitmap.Save(fs,
                        System.Drawing.Imaging.ImageFormat.Jpeg);
                        break;

                    case 3:
                        bitmap.Save(fs,
                        System.Drawing.Imaging.ImageFormat.Bmp);
                        break;
                }
                fs.Close();
            }
        }
开发者ID:Dahrkael,项目名称:RMDSCM,代码行数:32,代码来源:Image.cs


示例18: btn_resize_Click

        private void btn_resize_Click(object sender, EventArgs e)
        {
            if ( GLB_Data.MapSize.Depth > updwn_depth.Value ||
                 GLB_Data.MapSize.Width > updwn_width.Value ||
                 GLB_Data.MapSize.Height > updwn_height.Value)
            {
                dialog_result = MessageBox.Show("New new size is smaller than current map dimensions, " +
                                                             "some tiles will be lost\n Proceed?", "Warning",
                                                             MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation);

                if (dialog_result == DialogResult.No)
                {
                    return;
                }
            }

            dialog_result = MessageBox.Show("Warning, the resize operation cannot be undone.\nProceed?", "Warning",
                                                         MessageBoxButtons.YesNo, MessageBoxIcon.Warning);

            if (dialog_result == DialogResult.No)
            {
                return;
            }

            ResizeMap(Convert.ToInt32(updwn_depth.Value), Convert.ToInt32(updwn_width.Value), Convert.ToInt32(updwn_height.Value));

            this.Dispose(true);

            main_form.ResetCamera();
            main_form.ClearUndoRedo();
            main_form.CheckUndoRedo();
            main_form.InitScrollBars();
        }
开发者ID:plhearn,项目名称:tileEditor,代码行数:33,代码来源:ResizeForm.cs


示例19: exitToolStripMenuItem_Click

 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     DialogResult dialogResult = new DialogResult();
     if (!opened) dialogResult = MessageBox.Show("Are you sure you want to exit this application?", "EXIT", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     else if (opened) dialogResult = MessageBox.Show("A file is currently loaded. Are you sure you want to exit this application?\n\nAll unsaved changes will be lost.", "EXIT", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
     if (dialogResult == DialogResult.Yes) Environment.Exit(2);
 }
开发者ID:fiki574,项目名称:rAPB,代码行数:7,代码来源:Form1.cs


示例20: OverrideInformation

 public OverrideInformation(bool a, bool b, bool c, DialogResult d)
 {
     PointChecked = a;
     PolylineChecked = b;
     PolygonChecked = c;
     dialogResult = d;
 }
开发者ID:ntj,项目名称:GravurGIS,代码行数:7,代码来源:OverrideDialog.cs



注:本文中的DialogResult类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# DialogType类代码示例发布时间:2022-05-24
下一篇:
C# DialogMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap