M
Mark Roberts
Hello Everyone,
A co-worker and I came across something strange when a listbox is placed on
a page with a menu (these are the standard 2.0 controls, of course). The
menu is set to horizontal orientation and contains a few submenu items. It
seems that if the height is set on the listbox (as a percentage or pixels or
em), the listbox will flicker when you hover over the submenu items. This
may be specific to IE as the flickering does not happen for us under
Mozilla.
After quickly scouring these newsgroups and a bit of googling, the only
other reference to this problem was found here:
http://www.softconcepts.com/blogs/pkimmel/2005/11/aspnet-listbox-flicker.html
We tried the advice given there, but the flickering persisted. Playing
around a little more, we found that by controlling the listbox height via
the "Rows" property and not explicitly setting a height, the flickering does
not occur. This seems to be a reasonable work around for us; however, I am
curious what the cause of this flickering may be.
Here's some code that causes the flickering for us:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Menu ID="mnu" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Text="file">
<asp:MenuItem Text="new" />
<asp:MenuItem Text="open" />
<asp:MenuItem Text="exit" />
</asp:MenuItem>
<asp:MenuItem Text="edit">
<asp:MenuItem Text="cut" />
<asp:MenuItem Text="copy" />
<asp:MenuItem Text="paste" />
</asp:MenuItem>
<asp:MenuItem Text="view" />
<asp:MenuItem Text="help" />
</Items>
</asp:Menu>
<br />
<asp:ListBox ID="lb" Height="10em" runat="server"
style="width:100px">
<asp:ListItem Text="one" />
<asp:ListItem Text="two" />
<asp:ListItem Text="three" />
<asp:ListItem Text="four" />
</asp:ListBox>
</div>
</form>
</body>
</html>
If we replace the height property on the listbox with, say, "Rows="10"", the
flickering stops. Has anyone else encountered this behavior, or does anyone
have an idea of why it happens?
Thanks!
Mark
A co-worker and I came across something strange when a listbox is placed on
a page with a menu (these are the standard 2.0 controls, of course). The
menu is set to horizontal orientation and contains a few submenu items. It
seems that if the height is set on the listbox (as a percentage or pixels or
em), the listbox will flicker when you hover over the submenu items. This
may be specific to IE as the flickering does not happen for us under
Mozilla.
After quickly scouring these newsgroups and a bit of googling, the only
other reference to this problem was found here:
http://www.softconcepts.com/blogs/pkimmel/2005/11/aspnet-listbox-flicker.html
We tried the advice given there, but the flickering persisted. Playing
around a little more, we found that by controlling the listbox height via
the "Rows" property and not explicitly setting a height, the flickering does
not occur. This seems to be a reasonable work around for us; however, I am
curious what the cause of this flickering may be.
Here's some code that causes the flickering for us:
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Menu ID="mnu" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Text="file">
<asp:MenuItem Text="new" />
<asp:MenuItem Text="open" />
<asp:MenuItem Text="exit" />
</asp:MenuItem>
<asp:MenuItem Text="edit">
<asp:MenuItem Text="cut" />
<asp:MenuItem Text="copy" />
<asp:MenuItem Text="paste" />
</asp:MenuItem>
<asp:MenuItem Text="view" />
<asp:MenuItem Text="help" />
</Items>
</asp:Menu>
<br />
<asp:ListBox ID="lb" Height="10em" runat="server"
style="width:100px">
<asp:ListItem Text="one" />
<asp:ListItem Text="two" />
<asp:ListItem Text="three" />
<asp:ListItem Text="four" />
</asp:ListBox>
</div>
</form>
</body>
</html>
If we replace the height property on the listbox with, say, "Rows="10"", the
flickering stops. Has anyone else encountered this behavior, or does anyone
have an idea of why it happens?
Thanks!
Mark