コード例 #1
0
        public Form1()
        {
            this.InitializeComponent();
            this.htDevice   = new HtmlDevice();
            this.htCompiler = HtEngine.GetCompiler();
            HtEngine.RegisterDevice(this.htDevice);
            HtEngine.DefaultFontSize   = 14;
            HtEngine.DefaultFontFace   = "Arial";
            this.pictureBox1.BackColor = Color.RoyalBlue;

            this.pictureBox1.MouseMove +=
                (sender, args) =>
            {
                this.pictureBox1.Cursor = this.htCompiler.GetLink(args.X, args.Y) == null
                                                  ? Cursors.Default
                                                  : Cursors.Hand;
            };

            this.pictureBox1.MouseClick += (sender, args) =>
            {
                string link = this.htCompiler.GetLink(args.X, args.Y);
                if (link != null)
                {
                    MessageBox.Show("Link clicked: " + link);
                }
            };
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: mnasir786/html-engine-mini
        public Form1()
        {
            this.InitializeComponent();
            this.htDevice = new HtmlDevice();
            this.htCompiler = HtEngine.GetCompiler();
            HtEngine.RegisterDevice(this.htDevice);
            HtEngine.DefaultFontSize = 14;
            HtEngine.DefaultFontFace = "Arial";
            this.pictureBox1.BackColor = Color.RoyalBlue;

            this.pictureBox1.MouseMove +=
                (sender, args) =>
                {
                    this.pictureBox1.Cursor = this.htCompiler.GetLink(args.X, args.Y) == null
                                                  ? Cursors.Default
                                                  : Cursors.Hand;
                };

            this.pictureBox1.MouseClick += (sender, args) =>
            {
                string link = this.htCompiler.GetLink(args.X, args.Y);
                if (link != null)
                    MessageBox.Show("Link clicked: " + link);
            };
        }