Hello
I'm using a menu control (horizontal) in my app in order to create tabs so whenever the user clicks a menuitem he gets a different view, the number of menuitems is determined by the user's input so I add the menuitems in the vb code while running.
However, the fact that the number of items is unknown in advance causes me a problem because the menu can exceed the view width and even the entire page width.
I tried to find a way to build another "floor" of items or to dynamicaly hide exceeding items but without success.
I'm adding my code, hope someone can help me with a solution, thanks
<
asp:Menu ID="MD_Menu" runat="server" Orientation="Horizontal"
StaticMenuItemStyle-HorizontalPadding="10" StaticMenuItemStyle-ItemSpacing="0"
StaticMenuItemStyle-BorderColor="blue" StaticMenuItemStyle-BorderStyle="Solid" StaticMenuItemStyle-BorderWidth="1"
StaticSelectedStyle-Font-Bold="true" staticHoverStyle-BackColor="ActiveBorder" StaticSelectedStyle-BackColor="ActiveBorder">
<StaticMenuItemStyle BorderColor="Blue" BorderStyle="Solid" BorderWidth="1px" ItemSpacing="0px" HorizontalPadding="10px" />
<StaticSelectedStyle Font-Bold="True" BackColor="ActiveBorder" />
<StaticHoverStyle BackColor="ActiveBorder" />
</asp:Menu>
Public
Sub Build_Menu()
Dim i As Integer
Dim Full_Display_MI As New MenuItem
With Full_Display_MI
.Text = Localization.GetString(
"All_Floors", "~/DesktopModules/MainDisplay/App_LocalResources/ViewMainDisplay.ascx.resx")
.Value = 0
End With
If Menu_Index = 0 Then
Full_Display_MI.Selected =
True
End If
MD_Menu.Items.Add(Full_Display_MI)
Get_Floors_Details()
For i = 0 To Floors_Details.Count - 1
Dim Display_MI As New MenuItem
With Display_MI
.Text = Floors_Details.Item(i).Floor_Name
.Value = i + 1
End With
If Menu_Index = i + 1 Then
Display_MI.Selected =
True
End If
MD_Menu.Items.Add(Display_MI)
Next
End Sub