示例#1
0
        public void InsertBitmap(Int32 charIndex, Bitmap bitmap)
        {
            if (bitmap == null)
            {
                throw new ArgumentNullException("bitmap");
            }

            var clientSite = RichEditOle.GetClientSite();

            try
            {
                RichEditOle.InsertObject(RichEditObject.FromBitmap(charIndex, clientSite, bitmap));
            }
            finally
            {
                Marshal.ReleaseComObject(clientSite);
            }
        }
示例#2
0
        public void InsertControl(Int32 charIndex, Control control)
        {
            if (control == null)
            {
                throw new ArgumentNullException("control");
            }

            var clientSite = RichEditOle.GetClientSite();

            try
            {
                RichEditOle.InsertObject(RichEditObject.FromControl(charIndex, clientSite, control));
            }
            finally
            {
                Marshal.ReleaseComObject(clientSite);
            }
        }