12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System;
- using System.Collections.Generic;
- using System.Drawing;
- using System.Windows.Forms;
- namespace LYFZ.OtherExpansion.SkinControl
- {
- [ToolboxBitmap(typeof(RichTextBox))]
- public class SkinRichTextBox : RichTextBox
- {
- private RichEditOle _richEditOle;
- private Dictionary<int, REOBJECT> _oleObjectList;
- public Dictionary<int, REOBJECT> OleObjectList
- {
- get
- {
- if (this._oleObjectList == null)
- {
- this._oleObjectList = new Dictionary<int, REOBJECT>(10);
- }
- return this._oleObjectList;
- }
- }
- public RichEditOle RichEditOle
- {
- get
- {
- if (this._richEditOle == null && base.IsHandleCreated)
- {
- this._richEditOle = new RichEditOle(this);
- }
- return this._richEditOle;
- }
- }
- public bool InsertImageUseGifBox(string path)
- {
- bool result;
- try
- {
- SkinGifBox gif = new SkinGifBox();
- gif.BackColor = base.BackColor;
- gif.Image = Image.FromFile(path);
- this.RichEditOle.InsertControl(gif);
- result = true;
- }
- catch (Exception)
- {
- result = false;
- }
- return result;
- }
- }
- }
|