?
Solved

Making a .NET 2.0 Menu item not selectable

Posted on 2006-05-04
1
Medium Priority
?
612 Views
Last Modified: 2008-01-09
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
            .MaximumDynamicDisplayLevels = 10
            .StaticDisplayLevels = 1

            'General Formatting            
            .Font.Size = 10

            ' Static Menu Formatting
            .StaticMenuStyle.BackColor = Drawing.Color.FromArgb(23, 54, 117)
           
            .StaticMenuItemStyle.ForeColor = Drawing.Color.White
            .StaticMenuItemStyle.Width = 100
            .StaticMenuItemStyle.BorderColor = Drawing.Color.White
            .StaticMenuItemStyle.BorderWidth = 1
            .StaticMenuItemStyle.BorderStyle = BorderStyle.Solid
            .StaticMenuItemStyle.ItemSpacing = 0
            .StaticMenuItemStyle.HorizontalPadding = 5
           
            .StaticHoverStyle.Font.Bold = True
            .StaticHoverStyle.ForeColor = Drawing.Color.Yellow
            .StaticEnableDefaultPopOutImage = False
           
            'Dynamic Menu Formatting
            .DynamicMenuStyle.BackColor = Drawing.Color.White
            .DynamicMenuStyle.ForeColor = Drawing.Color.FromArgb(23, 54, 117)
            .DynamicMenuStyle.BorderColor = Drawing.Color.FromArgb(23, 54, 117)
            .DynamicMenuStyle.BorderWidth = 1
            .DynamicMenuStyle.BorderStyle = BorderStyle.Solid
            .DynamicMenuStyle.Width = 100
           
            .DynamicMenuItemStyle.HorizontalPadding = 5
           
            .DynamicBottomSeparatorImageUrl = "images/separator.gif"
            .DynamicHoverStyle.BackColor = Drawing.Color.FromArgb(23, 54, 117)
            .DynamicHoverStyle.Font.Bold = True
            .DynamicHoverStyle.ForeColor = Drawing.Color.Yellow
           
        End With
0
Comment
Question by:pbissegger
1 Comment
 
LVL 5

Accepted Solution

by:
razorback041 earned 1000 total points
ID: 16607646
set the selectable = false for each item in your static item collection, its not in the style
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses
Course of the Month16 days, 12 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question