Click here to Skip to main content
15,896,444 members
Articles / Desktop Programming / Windows Forms

A Professional HTML Renderer You Will Use

Rate me:
Please Sign up or sign in to vote.
4.91/5 (205 votes)
29 Jan 2009BSD4 min read 757.5K   23.4K   531  
100% managed code that draws HTML on any device
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;

namespace Html_Demo
{
    public static class Bridge
    {   
        #region Properties

        /// <summary>
        /// Gets the stylesheet for sample documents
        /// </summary>
        public static string StyleSheet
        {
            get {
                return @"
                    h1, h2, h3 { color: navy; font-weight:normal; }
                    body { font:10pt Tahoma }
		            pre  { border:solid 1px gray; background-color:#eee; padding:1em }
                    .gray    { color:gray; }
                    .example { background-color:#efefef; corner-radius:5px; padding:0.5em; }
                    .caption { font-weight:bold }
                    .whitehole { background-color:white; corner-radius:5px; padding:10px; }
                ";
            }
        }

        /// <summary>
        /// Gets a star image
        /// </summary>
        public static Image StarIcon
        {
            get { return Properties.Resources.favorites32; }
        }

        /// <summary>
        /// Gets the font icon
        /// </summary>
        public static Image FontIcon
        {
            get { return Properties.Resources.font32; }
        }

        /// <summary>
        /// Gets the comment icon
        /// </summary>
        public static Image CommentIcon
        {
            get { return Properties.Resources.comment16; }
        }
        
        /// <summary>
        /// Gets the image icon
        /// </summary>
        public static Image ImageIcon
        {
            get { return Properties.Resources.image32; }
        }

        /// <summary>
        /// Gets the method icon
        /// </summary>
        public static Image MethodIcon
        {
            get { return Properties.Resources.method16; }
        }

        /// <summary>
        /// Gets the property icon
        /// </summary>
        public static Image PropertyIcon
        {
            get { return Properties.Resources.property16; }
        }



        #endregion

        #region Methods

        /// <summary>
        /// Says hello with a message box
        /// </summary>
        public static void SayHello()
        {
            MessageBox.Show("Hello you!");
        }

        public static void ShowSampleForm()
        {
            using (SampleForm f = new SampleForm())
            {
                f.ShowDialog();
            }
        }

        #endregion
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License


Written By
Product Manager
United States United States
- I've been programming Windows and Web apps since 1997.
- My greatest concern nowadays is product, user interface, and usability.
- TypeScript / React expert

@geeksplainer

Comments and Discussions