pbissegger
asked on
Making a .NET 2.0 Menu item not selectable
I am trying to use the .NET 2.0 menu component, and have one small problem.
I am trying to disable the user from selecting an item in the static menu, but cannot figure out how.
I have a horizontal menu with dropdowns. To do so, I have one row of items (Static Menu) which always are there, and different dropdowns (DynamicMenus) which appear when I hover over items in the Static Menu.
I want to make the items in my Static menu not selectable - because I have no URLs / pages associated with them. They are just categories of items. However, I want to have the dropdowns appear when I hover over them.
Unfortunately, I cannot figure out how to disable the selection of the static menu items, while still making the dropdowns appear. I found one control (I cannot find it now) that set the items enabled property to false, but then none of the dynamic menus appeared.
Here is my code. Thanks,
Peter
--------------------
With Menu1
'Menu Configuration
.Orientation = Orientation.Horizontal
.DisappearAfter = 1000
.MaximumDynamicDisplayLeve ls = 10
.StaticDisplayLevels = 1
'General Formatting
.Font.Size = 10
' Static Menu Formatting
.StaticMenuStyle.BackColor = Drawing.Color.FromArgb(23, 54, 117)
.StaticMenuItemStyle.ForeC olor = Drawing.Color.White
.StaticMenuItemStyle.Width = 100
.StaticMenuItemStyle.Borde rColor = Drawing.Color.White
.StaticMenuItemStyle.Borde rWidth = 1
.StaticMenuItemStyle.Borde rStyle = BorderStyle.Solid
.StaticMenuItemStyle.ItemS pacing = 0
.StaticMenuItemStyle.Horiz ontalPaddi ng = 5
.StaticHoverStyle.Font.Bol d = True
.StaticHoverStyle.ForeColo r = Drawing.Color.Yellow
.StaticEnableDefaultPopOut Image = False
'Dynamic Menu Formatting
.DynamicMenuStyle.BackColo r = Drawing.Color.White
.DynamicMenuStyle.ForeColo r = Drawing.Color.FromArgb(23, 54, 117)
.DynamicMenuStyle.BorderCo lor = Drawing.Color.FromArgb(23, 54, 117)
.DynamicMenuStyle.BorderWi dth = 1
.DynamicMenuStyle.BorderSt yle = BorderStyle.Solid
.DynamicMenuStyle.Width = 100
.DynamicMenuItemStyle.Hori zontalPadd ing = 5
.DynamicBottomSeparatorIma geUrl = "images/separator.gif"
.DynamicHoverStyle.BackCol or = Drawing.Color.FromArgb(23, 54, 117)
.DynamicHoverStyle.Font.Bo ld = True
.DynamicHoverStyle.ForeCol or = Drawing.Color.Yellow
End With
I am trying to disable the user from selecting an item in the static menu, but cannot figure out how.
I have a horizontal menu with dropdowns. To do so, I have one row of items (Static Menu) which always are there, and different dropdowns (DynamicMenus) which appear when I hover over items in the Static Menu.
I want to make the items in my Static menu not selectable - because I have no URLs / pages associated with them. They are just categories of items. However, I want to have the dropdowns appear when I hover over them.
Unfortunately, I cannot figure out how to disable the selection of the static menu items, while still making the dropdowns appear. I found one control (I cannot find it now) that set the items enabled property to false, but then none of the dynamic menus appeared.
Here is my code. Thanks,
Peter
--------------------
With Menu1
'Menu Configuration
.Orientation = Orientation.Horizontal
.DisappearAfter = 1000
.MaximumDynamicDisplayLeve
.StaticDisplayLevels = 1
'General Formatting
.Font.Size = 10
' Static Menu Formatting
.StaticMenuStyle.BackColor
.StaticMenuItemStyle.ForeC
.StaticMenuItemStyle.Width
.StaticMenuItemStyle.Borde
.StaticMenuItemStyle.Borde
.StaticMenuItemStyle.Borde
.StaticMenuItemStyle.ItemS
.StaticMenuItemStyle.Horiz
.StaticHoverStyle.Font.Bol
.StaticHoverStyle.ForeColo
.StaticEnableDefaultPopOut
'Dynamic Menu Formatting
.DynamicMenuStyle.BackColo
.DynamicMenuStyle.ForeColo
.DynamicMenuStyle.BorderCo
.DynamicMenuStyle.BorderWi
.DynamicMenuStyle.BorderSt
.DynamicMenuStyle.Width = 100
.DynamicMenuItemStyle.Hori
.DynamicBottomSeparatorIma
.DynamicHoverStyle.BackCol
.DynamicHoverStyle.Font.Bo
.DynamicHoverStyle.ForeCol
End With
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.