Esempio n. 1
0
 void m_Control_SelectionChanged(object sender, HtmlColorSelectorEventArgs e)
 {
     this.Close(ToolStripDropDownCloseReason.CloseCalled);
 }
 void m_Control_SelectionChanged(object sender, HtmlColorSelectorEventArgs e)
 {
     this.Close(ToolStripDropDownCloseReason.CloseCalled);
 }
Esempio n. 3
0
 void Selector_SelectionChanged(object sender, HtmlColorSelectorEventArgs e)
 {
     HtmlColorSelector item = sender as HtmlColorSelector;
     if( (this.cEXWB1.WebbrowserObject == null) || (item == null) )
         return;
     if (item == selectionbackcolorSelector.Selector)
     {
         //Remove colors?
         if(e.SelectedColor != Color.Empty)
             cEXWB1.ExecCommand(true, "BackColor", false, ColorTranslator.ToHtml(e.SelectedColor));
         else
             cEXWB1.ExecCommand(true, "BackColor", false, "");
         return;
     }
     else if (item == selectionforecolorSelector1.Selector)
     {
         if(e.SelectedColor != Color.Empty)
             cEXWB1.ExecCommand(true, "ForeColor", false, ColorTranslator.ToHtml(e.SelectedColor));
         else
             cEXWB1.ExecCommand(true, "ForeColor", false, "");
         return;
     }
     IHTMLDocument2 pDoc2 = this.cEXWB1.WebbrowserObject.Document as IHTMLDocument2;
     if (pDoc2 == null)
         return;
     if (item == docbackcolorselector.Selector)
     {
         //Reset backcolor to nothing
         if (e.SelectedColor == Color.Empty)
         {
             pDoc2.bgColor = "";
             docbackcolor.BackColor = Control.DefaultBackColor;
         }
         else
         {
             pDoc2.bgColor = e.SelectedColor.Name;
             docbackcolor.BackColor = e.SelectedColor;
         }
     }
     else if (item == docforecolorselector.Selector)
     {
         if (e.SelectedColor == Color.Empty)
         {
             pDoc2.fgColor = "";
             docforecolor.BackColor = Control.DefaultBackColor;
         }
         else
         {
             pDoc2.fgColor = e.SelectedColor.Name;
             docforecolor.BackColor = e.SelectedColor;
         }
     }
     else if (item == doclinkcolorselector.Selector)
     {
         if (e.SelectedColor == Color.Empty)
         {
             pDoc2.linkColor = "";
             doclinkcolor.BackColor = Control.DefaultBackColor;
         }
         else
         {
             pDoc2.linkColor = e.SelectedColor.Name;
             doclinkcolor.BackColor = e.SelectedColor;
         }
     }
     else if (item == docalinkcolorselector.Selector)
     {
         if (e.SelectedColor == Color.Empty)
         {
             pDoc2.alinkColor = "";
             docalinkcolor.BackColor = Control.DefaultBackColor;
         }
         else
         {
             pDoc2.alinkColor = e.SelectedColor.Name;
             docalinkcolor.BackColor = e.SelectedColor;
         }
     }
     else if (item == docvlinkcolorselector.Selector)
     {
         if (e.SelectedColor == Color.Empty)
         {
             pDoc2.vlinkColor = "";
             docvlinkcolor.BackColor = Control.DefaultBackColor;
         }
         else
         {
             pDoc2.vlinkColor = e.SelectedColor.Name;
             docvlinkcolor.BackColor = e.SelectedColor;
         }
     }
 }