locked
Toolbars in the Windows Taskbar and popup menus RRS feed

  • Question

  • Hi everyone.

    I've been developing a toolbar based on the DotNet BandObjects project tutorial, which I've found to be very helpful.  I've placed a System.Windows.Forms.ToolStrip object inside my container, and I'm using that to organise the various controls I want on the toolbar.  (I've posted a similar query in the forum attached to that project, but I hope that someone over here might be more likely to see my question and know something useful.)

    That said, I seem to be having a problem with any controls that cause a menu to pop up, such as SplitButtons and DropDownButtons.  Specifically, the menus always appear outside the Windows taskbar.  This means that if my toolbar is visible on a Taskbar that's more than one row high, and a menu-causing component is clicked, the menu will appear quite some distance away from the button.

    I think it might be that the associated ToolStripDropDown object is somehow taking the Taskbar as the object which it's supposed to sit next to, rather than the toolbar, but I don't really know enough about the internals to understand how to fix it.

    I've tried a lot of random things with the ToolStripSplitButton.DropDown object, including a call to .SetBounds() to try and tell it to display somewhere else.  Unfortunately the popup menu seems to be really stuck on only displaying in the area above the taskbar, rather than overlapping it.

    One thing I have noticed is that if I change my Taskbar properties so the "Keep the taskbar on top of other windows" option is switched off, the popup menus will display right next to the button, as I'd expect them to.  Obviously I don't want to ask everyone to let their taskbar fall behind other windows just to make my toolbar more friendly, though.

    I'd be very greatful if anyone can give me some pointers about what might be going on here, and how to go about fixing it.  Is there some kind of property that needs to be set on the ToolStrip, ToolStripDropDown or ToolStripDropDownButton objects to tell them how and where to display a menu when the taskbar is involved?

    For the record, I'm developing in DotNet 2 using VS2005 running on Vista, but I see the same behaviour if I install my toolbar on an XP box.  I'm happy to provide more information on request.

    Thanks for any help.

    Mike.

    Monday, October 15, 2007 4:18 AM

Answers

  • The .NET V2.0 ToolStripItem components are fundamentally incompatible with shell app bars.  They contain code that ensures they are shown within the screen's working area, the value of Screen.WorkingArea.  A shell app bar reduces the size of the working area if their "keep on top" property is set.  I'm not aware of a workaround.
    Monday, October 15, 2007 2:33 PM

All replies

  • The .NET V2.0 ToolStripItem components are fundamentally incompatible with shell app bars.  They contain code that ensures they are shown within the screen's working area, the value of Screen.WorkingArea.  A shell app bar reduces the size of the working area if their "keep on top" property is set.  I'm not aware of a workaround.
    Monday, October 15, 2007 2:33 PM
  • Okay, in that case thanks for the note, which has probably saved a lot of time I would have spent fighting with this.  I guess I might have to think about writing my own controls.
    Monday, October 15, 2007 8:47 PM