private void customizedMessageBoxBtn_Click(object sender, System.EventArgs e)
        {
            NTaskDialog dlg = new NTaskDialog();

            dlg.PreferredWidth = 400;
            dlg.ProgressType   = TaskDialogProgressType.Marguee;
            dlg.MarqueeProgress.Start();

            dlg.Title = "Nevron User Interface Q4 2006";
            dlg.Content.Style.TextStrokeStyle   = new NStrokeStyle(1, Color.Brown);
            dlg.Content.Style.TextFillStyle     = new NColorFillStyle(Color.Wheat);
            dlg.Content.Style.TextSmoothingMode = SmoothingMode.AntiAlias;
            dlg.Content.Style.FontInfo          = new NThemeFontInfo("Trebuchet MS", 22f, FontStyleEx.Bold | FontStyleEx.Italic);
            dlg.Content.Text = "Downloading Nevron .NET Vision Q4 2006...";

            NPushButtonElement[] customButtons = new NPushButtonElement[2];
            NPushButtonElement   btn;

            btn                   = new NPushButtonElement();
            btn.Text              = "<b>Cancel Download</b>";
            btn.Image             = NSystemImages.Error;
            btn.ImageTextRelation = ImageTextRelation.ImageAboveText;
            btn.ImageSize         = new NSize(32, 32);
            btn.Id                = 0;
            customButtons[0]      = btn;

            btn                   = new NPushButtonElement();
            btn.Text              = "<b>Pause Download</b>";
            btn.Image             = NSystemImages.Exclamation;
            btn.ImageTextRelation = ImageTextRelation.ImageAboveText;
            btn.ImageSize         = new NSize(32, 32);
            btn.Id                = 1;
            customButtons[1]      = btn;

            dlg.UserButtons     = customButtons;
            dlg.DefaultButtonId = 2;

            dlg.Show();
        }
        private void progressDialogBtn_Click(object sender, System.EventArgs e)
        {
            NTaskDialog dlg = new NTaskDialog();

            dlg.PreferredWidth = 400;
            dlg.ProgressType   = TaskDialogProgressType.Standard;

            dlg.Title = "Nevron User Interface Q4 2006";
            dlg.Content.Style.FontInfo = new NThemeFontInfo("Tahoma", 10f, FontStyleEx.Regular);
            dlg.Content.Text           = "Downloading Nevron .NET Vision Q4 2006...";
            dlg.Content.Image          = NSystemImages.Information;
            dlg.Content.ImageSize      = new NSize(32, 32);
            dlg.ProgressType           = TaskDialogProgressType.Standard;
            dlg.EnableTimer            = true;
            dlg.Verification.Text      = "Close this dialog when download is complete";
            dlg.Notify += m_CallBack;

            //inint buttons
            NPushButtonElement cancelBtn = new NPushButtonElement();

            cancelBtn.Text = "Cancel";
            cancelBtn.Id   = 100;

            NPushButtonElement pauseBtn = new NPushButtonElement();

            pauseBtn.Text = "Pause";
            pauseBtn.Id   = 101;

            NPushButtonElement resumeBtn = new NPushButtonElement();

            resumeBtn.Text = "Resume";
            resumeBtn.Id   = 102;

            dlg.UserButtons = new NPushButtonElement[] { cancelBtn, pauseBtn, resumeBtn };
            //the defaulted button is "Pause"
            dlg.DefaultButtonId = 101;
            dlg.Show();
        }
Exemplo n.º 3
0
        public NThemableElementsUC(MainForm f) : base(f)
        {
            InitializeComponent();

            Dock = DockStyle.Fill;

            NRectShape shape = new NRectShape();

            shape.StrokeStyle = new NStrokeStyle(3, Color.Brown);

            m_Host             = new NUIElementHost();
            m_ElementContainer = new NUIElementContainer();
            m_ElementContainer.Style.Background = shape;
            m_Host.Bounds = new Rectangle(10, 10, 250, 250);

            //add one button
            NPushButtonElement button = new NPushButtonElement();

            button.Text   = "Push Button";
            button.Bounds = new NRectangle(10, 10, 100, 24);
            m_ElementContainer.AddChild(button);

            //add one checkbox
            NCheckBoxElement checkBox = new NCheckBoxElement();

            checkBox.Text        = "Check Box";
            checkBox.ThreeStates = true;
            checkBox.Bounds      = new NRectangle(10, 36, 100, 24);
            m_ElementContainer.AddChild(checkBox);

            //add one radiobox
            NRadioBoxElement radioBox = new NRadioBoxElement();

            radioBox.Text   = "Radio Box 1";
            radioBox.Bounds = new NRectangle(10, 62, 100, 24);
            m_ElementContainer.AddChild(radioBox);

            radioBox        = new NRadioBoxElement();
            radioBox.Text   = "Radio Box 2";
            radioBox.Bounds = new NRectangle(120, 62, 100, 24);
            m_ElementContainer.AddChild(radioBox);

            NCheckButtonElement checkButton = new NCheckButtonElement();

            checkButton.Text   = "Check Button";
            checkButton.Bounds = new NRectangle(10, 88, 100, 24);
            m_ElementContainer.AddChild(checkButton);

            NRadioButtonElement radioButton = new NRadioButtonElement();

            radioButton.Text   = "Radio Button 1";
            radioButton.Bounds = new NRectangle(10, 116, 100, 24);
            m_ElementContainer.AddChild(radioButton);

            radioButton        = new NRadioButtonElement();
            radioButton.Text   = "Radio Button 2";
            radioButton.Bounds = new NRectangle(120, 116, 100, 24);
            m_ElementContainer.AddChild(radioButton);

            m_Host.Element = m_ElementContainer;
            m_Host.Parent  = this;
        }
        private void vistaLikeNotification_Click(object sender, System.EventArgs e)
        {
            NTaskDialog dlg = new NTaskDialog();

            dlg.Title             = "Copy File";
            dlg.PreferredWidth    = 480;
            dlg.PredefinedButtons = TaskDialogButtons.Cancel;

            NThemeFontInfo fi = new NThemeFontInfo("Tahoma", 9, FontStyleEx.Regular);

            NLabelElement label = dlg.Content;

            label.Style.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            label.Text = "<font color='navy' size='11' face='Tahoma'>There is already a file with the same name in this location.</font><br/><br/>What would you like to do:";

            NPushButtonElement[] largeButtons = new NPushButtonElement[3];
            NPushButtonElement   button;
            string text;

            button    = new NPushButtonElement();
            button.Id = 100;
            button.TreatAsOneEntity        = false;
            button.ImageAlign              = ContentAlignment.TopLeft;
            button.TextAlign               = ContentAlignment.TopLeft;
            button.Image                   = NSystemImages.Question;
            button.ImageSize               = new NSize(32, 32);
            button.ContentAlign            = ContentAlignment.MiddleLeft;
            button.Style.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            button.Style.FontInfo          = fi;
            text            = "<font color='navy' size='12'>Copy and replace</font><br/><font color='navy'>Replace the file in the destination folder with the file you are copying:</font><br/>";
            text           += "<b>NTaskDialog.cs</b><br/>";
            text           += @"<font color='navy'>NTaskDialog (C:\Projects\UI\WinForm\Controls\Forms\TaskDialog)</font>";
            text           += "<br/>Size: 14 KB<br/>";
            text           += "Date Modified: 03/03/2007 10:00 AM (Newer)";
            button.Text     = text;
            largeButtons[0] = button;

            button    = new NPushButtonElement();
            button.Id = 101;
            button.TreatAsOneEntity        = false;
            button.ImageAlign              = ContentAlignment.TopLeft;
            button.TextAlign               = ContentAlignment.TopLeft;
            button.Image                   = NSystemImages.Question;
            button.ImageSize               = new NSize(32, 32);
            button.ContentAlign            = ContentAlignment.MiddleLeft;
            button.Style.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            button.Style.FontInfo          = fi;
            text            = "<font color='navy' size='12'>Don't Copy</font><br/><font color='navy'>No files will be changed. Leave this file in the destination folder:</font><br/>";
            text           += "<b>NTaskDialog.cs</b><br/>";
            text           += @"<font color='navy'>NTaskDialog (C:\OldProjects\UI\WinForm\Controls\Forms\TaskDialog)</font>";
            text           += "<br/>Size: 12 KB (Smaller)<br/>";
            text           += "Date Modified: 03/03/2007 09:00 AM";
            button.Text     = text;
            largeButtons[1] = button;

            button    = new NPushButtonElement();
            button.Id = 102;
            button.TreatAsOneEntity        = false;
            button.ImageAlign              = ContentAlignment.TopLeft;
            button.TextAlign               = ContentAlignment.TopLeft;
            button.Image                   = NSystemImages.Question;
            button.ImageSize               = new NSize(32, 32);
            button.ContentAlign            = ContentAlignment.MiddleLeft;
            button.Style.TextRenderingHint = TextRenderingHint.ClearTypeGridFit;
            button.Style.FontInfo          = fi;
            text            = "<font color='navy' size='12'>Copy, but keep both files</font><br/><font color='navy'>The file you are copying will be renamed \"NTaskDialog (2).cs\"</font>";
            button.Text     = text;
            largeButtons[2] = button;

            dlg.DefaultButtonId  = 100;
            dlg.LargeUserButtons = largeButtons;
            dlg.Show();
        }