public mhEditor() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); pHtml = "<indent ind=\"15\">abcdefg hijklmn opqrstuv wxyz<b class=\"day\">opqrstuv</b>wxyz</indent>" + "<sup>12345</sup>67<sub>890</sub><a href=\"aLink\">link</a>" + "<font color=\"#00FF00\" size=\"25\" name=\"Lucida Console\">font</font>"; pCss = "b.day {color:red;}"; pHtml = ""; mh = new MiniHtml(); mh.ParseMode = parseMode.Text; mh.widthLimit = Width; mh.parser.Parse(pHtml); mh.parser.ParseCss(pCss); mh.documentOutput.backColor = Color.White; mh.documentOutput.selectionColor = Color.LightGreen; #if mh_dotNet_10 this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer, true); #elif mh_dotNet_20 this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true); #endif }
public mhLabel() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); mh = new MiniHtml(); BackColor = Color.White; }
public void UpdateHtml() { mh = new MiniHtml(); mh.widthLimit = Math.Max(10, mhOutput.Width); mh.ParseMode = ParseMode; mh.parser.Parse(pHtml); mh.parser.ParseCss(pCss); mh.documentOutput.Update(); mhOutput.Image = new Bitmap(mh.widthLimit, (Int32)(mh.documentOutput.Height())); GraphicsOutputType output = (GraphicsOutputType)(mh.documentOutput); output.drawCursor = false; output.backColor = this.BackColor; output.outputGraphics = Graphics.FromImage(mhOutput.Image); output.ClearBackground(); mh.documentOutput.Output(); }