public Resultados(Dictionary <string, Dictionary <string, Dictionary <string, object> > > data) { datos = data; TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); string html_body = ""; foreach (var pagina in datos) { html_body += "<div style='text-align='center''><h1>" + "Reporte de '" + pagina.Key + "'" + "</h1></div><br>"; foreach (var metricas in pagina.Value) { html_body += "<h2 style='text-align='center''>" + "Datos de '" + metricas.Key + "'</h2><br>"; foreach (var campo in metricas.Value) { html_body += "<b>" + campo.Key + ": </b>" + campo.Value + "<br>"; } } } htmlPanel.Text = html_body; htmlPanel.Dock = DockStyle.Fill; Controls.Add(htmlPanel); InitializeComponent(); }
public testi() { InitializeComponent(); TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); htmlPanel.Text = "<p><h1>Hello World</h1>This is html rendered text</p><img src='C:/Users/Moskau/AppData/Roaming/Advanced Combat Tracker/Config/TriggernometryRemoteImages/eb1888cce428cd451d039b0dc03ca9aa.png' /></p><img src='C:/Users/Moskau/AppData/Roaming/Advanced Combat Tracker/Config/TriggernometryRemoteImages/dd99012d2fb7540b7cfc70456b729fca.gif' />"; htmlPanel.Dock = DockStyle.Fill; htmlPanel.IsContextMenuEnabled = false; Controls.Add(htmlPanel); }
public frmHtmlWindow() { InitializeComponent(); TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); //htmlPanel.Text = "<p><h1>Hello World</h1>This is html rendered text</p>"; htmlPanel.Text = Add_String("Test Status"); //htmlPanel.BackColor = System.Drawing.Color.Red; htmlPanel.Dock = DockStyle.Fill; Controls.Add(htmlPanel); }
public Form1() { InitializeComponent(); htmlPanel = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); htmlPanel.UseGdiPlusTextRendering = true; htmlPanel.Dock = DockStyle.Fill; groupBox1.Controls.Add(htmlPanel); //Controls.Add(htmlPanel); txtPath.Text = "C:\\Users\\wouter\\Desktop\\scene_00011.png"; }
private void HTMLPanel_Load(object sender, EventArgs e) { string text = "<!DOCTYPE html><html><head><title>Dimension</title></head><body><h1>Welcome to Dimension!</h1><p>It's still young, so there aren't many networks to join. Check these ones out:</p><h2>List of Bootstraps</h2><ul><li><a href='DimensionBootstrap://www.9thcircle.net/Projects/Dimension/bootstrap.php'>9th Circle Test Bootstrap</a></li><li><a href='DimensionBootstrap://www.respawn.com.au/dimension.php'>Respawn LAN Bootstrap</a></li><li><a href='DimensionLAN://LAN'>Your local network</a></li></ul></body></html>"; var p = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); p.Dock = DockStyle.Fill; p.BaseStylesheet = "h1{color:black;}"; p.Text = text; p.LinkClicked += navigate; Controls.Add(p); }
public UpdatesAvailableDialog(Image appIcon, string curVersion, string curChannel, string curBuild, string newVersion, string newChannel, string newBuild, UpdateNotes updateNotes, bool installAsAdmin) { InitializeComponent(); StyleManager.UpdateAmbientColors(this); if (installAsAdmin) { ButtonX_Install.Image = BaseFeatures.GetUacShieldImage(); } PictureBox_AppIcon.Image = appIcon ?? Icon.ToBitmap(); LabelX_CurrentVersion.Text = curVersion; LabelX_CurrentChannel.Text = curChannel; LabelX_CurrentBuild.Text = curBuild; LabelX_NewVersion.Text = newVersion; LabelX_NewChannel.Text = newChannel; LabelX_NewBuild.Text = newBuild; // Update Notes Control updateNotesControl = null; switch (updateNotes.ContentType) { case UpdateNotesContentType.PlainText: var newUpdateNotesControl = new DevComponents.DotNetBar.Controls.RichTextBoxEx { Text = updateNotes.Content }; newUpdateNotesControl.BackgroundStyle.Class = DevComponents.DotNetBar.Rendering.ElementStyleClassKeys.RichTextBoxBorderKey; updateNotesControl = newUpdateNotesControl; break; case UpdateNotesContentType.Markdown: updateNotesControl = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel { Text = CommonMark.CommonMarkConverter.Convert(updateNotes.Content) }; break; case UpdateNotesContentType.HTML: updateNotesControl = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel { Text = updateNotes.Content }; break; } if (updateNotesControl is object) { updateNotesControl.Dock = DockStyle.Fill; Panel_Changelog.Controls.Add(updateNotesControl); } }
/// <summary> /// Click the Trade row where we load the details and show in a browser /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Trade_Click(object sender, EventArgs e) { // get the Trade object Label panel = sender as Label; var trade = m_trades.Where(t => t.Id == panel.Tag as string).FirstOrDefault(); if (trade == null) { return; } // inject browser TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel browser; if (m_browserHeight != 0) { tradesContainer.Height -= m_browserHeight; browserContainer.Height = m_browserHeight; m_browserHeight = 0; browser = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); browser.Dock = DockStyle.Fill; browser.Location = new Point(0, 0); browser.Size = new Size(browserContainer.Width, browserContainer.Height); browserContainer.Controls.Add(browser); } else { browser = browserContainer.Controls[0] as TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel; } // pull details segment and merge with normal html var cursor = Cursor.Current; try { Cursor.Current = Cursors.WaitCursor; Application.DoEvents(); browser.Text = this.AuthenticatorData.GetClient().GetConfirmationDetails(trade); } catch (Exception ex) { browser.Text = "<html><head></head><body><p>" + ex.Message + "</p>" + ex.StackTrace.Replace(Environment.NewLine, "<br>") + "</body></html>"; } finally { Cursor.Current = cursor; } }
/// <summary> /// Create new Notification /// </summary> /// <param name="title">title text</param> /// <param name="body">main body, as text or HTML</param> /// <param name="buttons">optional list of buttons</param> /// <param name="animation">optional animation overrides</param> public Notification(string title, string body, int hideInMs = 0, List <NotificationButton> buttons = null, NotificationAnimation animation = null) : base() { InitializeComponent(); if (animation == null) { animation = new NotificationAnimation(); } lifeTimer.Interval = (hideInMs > 0 ? hideInMs : int.MaxValue); // set the title labelTitle.Text = title; // show or hide the buttons _buttons = buttons; if (_buttons == null || _buttons.Count == 0) { buttonPanel.Visible = false; } else { buttonPanel.Visible = true; this.Height += buttonPanel.Height; this.labelBody.Height -= buttonPanel.Height; this.htmlBody.Height -= buttonPanel.Height; if (_buttons.Count >= 1) { button1.Text = _buttons[0].Text; button1.Tag = _buttons[0]; } if (_buttons.Count >= 2) { button2.Text = _buttons[1].Text; button2.Tag = _buttons[1]; button2.Visible = true; } if (_buttons.Count >= 3) { button3.Text = _buttons[2].Text; button3.Tag = _buttons[2]; button3.Visible = true; } } // set the body text or html if (body.IndexOf("<") == -1) { labelBody.Text = body; labelBody.Visible = true; } else { // inject browser TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel browser = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); browser.Dock = DockStyle.Fill; browser.Location = new Point(0, 0); browser.Size = new Size(htmlBody.Width, htmlBody.Height); htmlBody.Controls.Add(browser); browser.Text = "<!doctype html><html><head><meta charset=\"UTF-8\"><style>html,body{width:100%;height:100%;margin:0;padding:0;}body{margin:0 5px;font-size:14px;border:1px;}h1{font-size:16px;font-weight:normal;margin:0;padding:0 0 4px 0;}</style></head><body>" + body + "</body></html>"; browser.AutoScroll = false; browser.IsSelectionEnabled = false; browser.Click += Notification_Click; htmlBody.Visible = true; } if (OnNotificationClicked != null) { this.labelBody.Cursor = Cursors.Hand; this.htmlBody.Cursor = Cursors.Hand; } _animator = new FormAnimator(this, animation.Method, animation.Direction, 500); //Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width - 5, Height - 5, 5, 5)); }
/// <summary> /// Create new Notification /// </summary> /// <param name="title">title text</param> /// <param name="body">main body, as text or HTML</param> /// <param name="buttons">optional list of buttons</param> /// <param name="animation">optional animation overrides</param> public Notification(string title, string body, int hideInMs = 0, List<NotificationButton> buttons = null, NotificationAnimation animation = null) : base() { InitializeComponent(); if (animation == null) { animation = new NotificationAnimation(); } lifeTimer.Interval = (hideInMs > 0 ? hideInMs : int.MaxValue); // set the title labelTitle.Text = title; // show or hide the buttons _buttons = buttons; if (_buttons == null || _buttons.Count == 0) { buttonPanel.Visible = false; } else { buttonPanel.Visible = true; this.Height += buttonPanel.Height; this.labelBody.Height -= buttonPanel.Height; this.htmlBody.Height -= buttonPanel.Height; if (_buttons.Count >= 1) { button1.Text = _buttons[0].Text; button1.Tag = _buttons[0]; } if (_buttons.Count >= 2) { button2.Text = _buttons[1].Text; button2.Tag = _buttons[1]; button2.Visible = true; } if (_buttons.Count >= 3) { button3.Text = _buttons[2].Text; button3.Tag = _buttons[2]; button3.Visible = true; } } // set the body text or html if (body.IndexOf("<") == -1) { labelBody.Text = body; labelBody.Visible = true; } else { // inject browser TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel browser = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); browser.Dock = DockStyle.Fill; browser.Location = new Point(0, 0); browser.Size = new Size(htmlBody.Width, htmlBody.Height); htmlBody.Controls.Add(browser); browser.Text = "<!doctype html><html><head><meta charset=\"UTF-8\"><style>html,body{width:100%;height:100%;margin:0;padding:0;}body{margin:0 5px;font-size:14px;border:1px;}h1{font-size:16px;font-weight:normal;margin:0;padding:0 0 4px 0;}</style></head><body>" + body + "</body></html>"; browser.AutoScroll = false; browser.IsSelectionEnabled = false; browser.Click += Notification_Click; htmlBody.Visible = true; } if (OnNotificationClicked != null) { this.labelBody.Cursor = Cursors.Hand; this.htmlBody.Cursor = Cursors.Hand; } _animator = new FormAnimator(this, animation.Method, animation.Direction, 500); //Region = Region.FromHrgn(CreateRoundRectRgn(0, 0, Width - 5, Height - 5, 5, 5)); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Notification)); this.lifeTimer = new System.Windows.Forms.Timer(this.components); this.labelTitle = new System.Windows.Forms.Label(); this.txtQuickReply = new System.Windows.Forms.TextBox(); this.htmlBody = new TheArtOfDev.HtmlRenderer.WinForms.HtmlPanel(); this.btnSnooze = new System.Windows.Forms.Button(); this.SuspendLayout(); // // lifeTimer // this.lifeTimer.Tick += new System.EventHandler(this.lifeTimer_Tick); // // labelTitle // this.labelTitle.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.labelTitle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(62)))), ((int)(((byte)(49)))), ((int)(((byte)(60))))); this.labelTitle.Font = new System.Drawing.Font("Calibri", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelTitle.ForeColor = System.Drawing.Color.White; this.labelTitle.Location = new System.Drawing.Point(0, 1); this.labelTitle.Name = "labelTitle"; this.labelTitle.Size = new System.Drawing.Size(294, 24); this.labelTitle.TabIndex = 0; this.labelTitle.Text = "title goes here"; this.labelTitle.Click += new System.EventHandler(this.labelTitle_Click); // // txtQuickReply // this.txtQuickReply.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.txtQuickReply.Location = new System.Drawing.Point(8, 128); this.txtQuickReply.Name = "txtQuickReply"; this.txtQuickReply.Size = new System.Drawing.Size(278, 20); this.txtQuickReply.TabIndex = 1; this.txtQuickReply.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtQuickReply_KeyDown); // // htmlBody // this.htmlBody.AutoScroll = true; this.htmlBody.AutoScrollMinSize = new System.Drawing.Size(278, 20); this.htmlBody.BackColor = System.Drawing.Color.Transparent; this.htmlBody.BaseStylesheet = null; this.htmlBody.Cursor = System.Windows.Forms.Cursors.IBeam; this.htmlBody.Location = new System.Drawing.Point(8, 25); this.htmlBody.Name = "htmlBody"; this.htmlBody.Size = new System.Drawing.Size(278, 96); this.htmlBody.TabIndex = 2; this.htmlBody.Text = "<p style=\"margin: 0; color: yellow; font-weight: bold\">hi</p>"; // // btnSnooze // this.btnSnooze.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(57)))), ((int)(((byte)(75))))); this.btnSnooze.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSnooze.ForeColor = System.Drawing.Color.White; this.btnSnooze.Location = new System.Drawing.Point(224, 1); this.btnSnooze.Name = "btnSnooze"; this.btnSnooze.Size = new System.Drawing.Size(53, 22); this.btnSnooze.TabIndex = 3; this.btnSnooze.Text = "Snooze"; this.btnSnooze.UseVisualStyleBackColor = false; this.btnSnooze.Click += new System.EventHandler(this.btnSnooze_Click); // // Notification // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(77)))), ((int)(((byte)(57)))), ((int)(((byte)(75))))); this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(294, 159); this.ControlBox = false; this.Controls.Add(this.btnSnooze); this.Controls.Add(this.htmlBody); this.Controls.Add(this.txtQuickReply); this.Controls.Add(this.labelTitle); this.DoubleBuffered = true; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "Notification"; this.ShowIcon = false; this.ShowInTaskbar = false; this.Text = "EDGE Shop Flag Notification"; this.TopMost = true; this.Activated += new System.EventHandler(this.Notification_Activated); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.Notification_FormClosed); this.Load += new System.EventHandler(this.Notification_Load); this.Shown += new System.EventHandler(this.Notification_Shown); this.Click += new System.EventHandler(this.Notification_Click); this.ResumeLayout(false); this.PerformLayout(); }