English 中文(简体)
传统信息
原标题:Custom MessageBox For Errors and Information

根据我的研究,在母体形式上向中心传递信息Box表格的唯一途径是撰写一个习俗信息Box类。 我成功地实施了“习俗与现实”表格,并能够把我的错误和信息信息放在括号内。 然而,我无法指出,如何使习惯做法Box形成静态,以便我不必立即提出我的新的习俗模式。 我只想说一种静态的方法,例如:

Custom Custom(类型、信息等)

我的电文类基本版本如下。 理想的情况是,我要具备显示这种形式的功能,而不必立即通报我的习俗。 这是可能的吗?

namespace MarineService
{
    public partial class CustomMessageForm : DevExpress.XtraEditors.XtraForm
    {
        private static CustomMessageForm form = new CustomMessageForm();

        public CustomMessageForm()
        {
            InitializeComponent();
        }

        public void ShowDialog(string type, string message)
        {
            this.Text = type + "Information";
            this.groupMessage.Text = type + "Information";
            this.memoEditMessage.Lines[0] = message;

        }
    }
}
最佳回答

与此类似:

public partial class CustomMessageForm : DevExpress.XtraEditors.XtraForm
{
        private static CustomMessageForm form = new CustomMessageForm();

        public CustomMessageForm()
        {
            InitializeComponent();
        }

        private void ShowDialog(string type, string message)
        {
            form .Text = type + "Information";
            form .groupMessage.Text = type + "Information";
            form .memoEditMessage.Lines[0] = message;
            form.ShowDialog();

        }

        public static Show(string type, string message)
        {
           if(form.Visible)
              form.Close();
           ShowDialog(type, message);
        }
}

并且利用这种方式:

CustomMessageForm.Show("customtype", "warning!");

与此类似,只是一个想法。

如果这不是你要求的话,请澄清。

问题回答

暂无回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...

热门标签