protected override void Execute(CodeActivityContext context) { try { string _Captions = Captions.Get(context); string _Text = Text.Get(context); if (_Captions == "") { _Captions = "RPAStudio"; } if (Buttons > 1) { Buttons++; } MessageBoxOptions mo; if (TopMost) { mo = MessageBoxOptions.DefaultDesktopOnly; } else { mo = MessageBoxOptions.None; } var result = MessageBox.Show(_Text, _Captions, (MessageBoxButton)Buttons, MessageBoxImage.None, MessageBoxResult.None, mo); ChosenButton.Set(context, result.ToString()); } catch (Exception e) { SharedObject.Instance.Output(SharedObject.enOutputType.Error, "有一个错误产生", e.Message); } }