Beispiel #1
0
 private void btnYes_Click(object sender, RoutedEventArgs e)
 {
     _messageBoxResult = LED_MessageBoxResult.Yes;
     toolMessageBox.Close();
 }
Beispiel #2
0
        public void setMessageinfo(LED_DialogParameters parameters)
        {
            TitleInfo.Content = parameters.Hander;//设置标题

            //                       parameters.Content = @"Starting with SIMATIC IT 6.3 version, most of the COM Interfaces for the
            ///           integration of the Components of the Production Suite with Production Modeler
            ///           are deprecated (refer to the Notes Page for the detailed list)";
               // parameters.Content = @"随后民警对男子随身携带的物品进行检查,发现他裤子内裆部竟然藏着一包用卫生纸包裹严实的小袋,而袋子里装着大量白色粉末。“经鉴定,男子携带的可疑物是冰毒,约重49克。”民警说,男子是四川人,今年43岁,是替人带毒品到宝鸡的。随后民警对男子随身携带的物品进行检查,发现他裤子内裆部竟然藏着一包用卫生纸包裹严实的小袋,而袋子里装着大量白色粉末。“经鉴定,男子携带的可疑物是冰毒,约重49克。”民警说,男子是四川人,今年43岁,是替人带毒品到宝鸡的。";

             boardMain.Height = this.Height = this.MaxHeight = 120;
               // boardMain.Height = this.Height = this.MaxHeight =25 * Encoding.Default.GetBytes(parameters.Content).Length / 28;
            MessageInfo.Text = parameters.Content;//设置内容
            //   boardMain.Height = this.Height = this.MaxHeight = 500;

            _messageBoxResult = LED_MessageBoxResult.Cancel;

            switch (parameters.MessageBoxButton)
            {
                case LED_MessageBoxButton.OK://显示默认对话框(确认对话框)
                    btnOK.Visibility = Visibility.Visible;

                    btnYes.Visibility = Visibility.Collapsed;
                    btnNo.Visibility = Visibility.Collapsed;
                    btnCancel.Visibility = Visibility.Collapsed;
                    break;
                case LED_MessageBoxButton.OKCancel://显示确认、取消对话框
                    btnOK.Visibility = Visibility.Visible;
                    btnCancel.Visibility = Visibility.Visible;

                    btnYes.Visibility = Visibility.Collapsed;
                    btnNo.Visibility = Visibility.Collapsed;
                    break;
                case LED_MessageBoxButton.YesNoCancel://显示是、否、取消对话框
                    btnYes.Visibility = Visibility.Visible;
                    btnNo.Visibility = Visibility.Visible;
                    btnCancel.Visibility = Visibility.Visible;
                    btnOK.Visibility = Visibility.Collapsed;
                    break;
                case LED_MessageBoxButton.YesNo://显示是、否对话框
                    btnYes.Visibility = Visibility.Visible;
                    btnNo.Visibility = Visibility.Visible;
                    btnCancel.Visibility = Visibility.Collapsed;
                    btnOK.Visibility = Visibility.Collapsed;
                    break;
                default:
                    break;
            }
        }