Spread ASP.NET 14
FarPoint.Web.Spread Assembly / FarPoint.Web.Spread Namespace / ContextMenuStyle Class / ItemHoverForeColor Property
Example


In This Topic
    ItemHoverForeColor Property
    In This Topic
    Gets or sets the forecolor of the context menu item when the mouse is over the item.
    Syntax
    'Declaration
     
    Public Property ItemHoverForeColor As Color
    'Usage
     
    Dim instance As ContextMenuStyle
    Dim value As Color
     
    instance.ItemHoverForeColor = value
     
    value = instance.ItemHoverForeColor
    public Color ItemHoverForeColor {get; set;}

    Property Value

    The forecolor of the context menu item.
    Example
    This example sets the ItemHoverForeColor property.
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverBackColor = System.Drawing.Color.FromArgb(88, 149, 77);
    FpSpread1.ActiveSheetView.ContextMenuStyle.Seperator = new FarPoint.Web.Spread.Border(BorderStyle.Dotted, System.Drawing.Color.Red, 2);
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverBorder = new FarPoint.Web.Spread.Border(BorderStyle.Dashed, System.Drawing.Color.Aqua, 2);
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemFont.Bold = true;
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverForeColor = System.Drawing.Color.Green;
    FarPoint.Web.Spread.ContextMenu viewportMenu = new FarPoint.Web.Spread.ContextMenu();
    viewportMenu.Type = FarPoint.Web.Spread.ContextMenuType.Viewport;
    FarPoint.Web.Spread.MenuItem customViewportItem = new FarPoint.Web.Spread.MenuItem("Viewport item 1");
    customViewportItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem(" First Item"));
    customViewportItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem("-"));
    customViewportItem.ChildItems.Add(new FarPoint.Web.Spread.MenuItem(" Second Item"));
    viewportMenu.Items.Add(customViewportItem);
    FpSpread1.EnableContextMenu = true;
    FpSpread1.ContextMenus.Add(viewportMenu);
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverBackColor = System.Drawing.Color.FromArgb(88, 149, 77)
    FpSpread1.ActiveSheetView.ContextMenuStyle.Seperator = New FarPoint.Web.Spread.Border(BorderStyle.Dotted, System.Drawing.Color.Red, 2)
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverBorder = New FarPoint.Web.Spread.Border(BorderStyle.Dashed, System.Drawing.Color.Aqua, 2)
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemFont.Bold = True
    FpSpread1.ActiveSheetView.ContextMenuStyle.ItemHoverForeColor = System.Drawing.Color.Green
    Dim viewportMenu As New FarPoint.Web.Spread.ContextMenu()
    viewportMenu.Type = FarPoint.Web.Spread.ContextMenuType.Viewport
    Dim customViewportItem As New FarPoint.Web.Spread.MenuItem("Viewport item 1")
    customViewportItem.ChildItems.Add(New FarPoint.Web.Spread.MenuItem(" First Item"))
    customViewportItem.ChildItems.Add(New FarPoint.Web.Spread.MenuItem("-"))
    customViewportItem.ChildItems.Add(New FarPoint.Web.Spread.MenuItem(" Second Item"))
    viewportMenu.Items.Add(customViewportItem)
    FpSpread1.EnableContextMenu = True
    FpSpread1.ContextMenus.Add(viewportMenu)
    See Also