locked
Sliding Toolbars RRS feed

  • Question

  • I have a ToolBarTray, and two ToolBars in it. The tray and toolbars are not locked. I'm using Windows XP SP3 32-bit edition, and WPF 3.5 sp1 with Visual Studio 2008 SP1.

    When I drag the toolbars around, I can make them all line up to the left in one band each, or I can make them both stack to the left in a single band. However, while doing that, I don't see the toolbars following the cursor at all (quite unlike most normal applications, and the WinForms toolbar/rebar controls). That's somewhat annoying. Is there some property or function I'm missing?

    However, the most annoying part is that I can find no way to slide the toobars over in their bands -- if I wanted one toolbar on the left, and one on the right, in the same band, I can't do that. They force-stack themselves with left packing, no matter what. Again, is there some property or function I'm missing?

    Finally, I added ToolBarTrays on the left/right/top/bottom in a DockPanel, with toolbars only in the top. In a WinForms app (or any general app, like Office or Visual Studio), I can drag toolbars to generally "hidden" tool bar areas, and they will dock to that side. I can't get that to happen with visible (but zero size) WPF ToolBarTrays. What am I missing?

    So far, the toolbar experience compared to WinForms and MFC (and even Win32 ReBar!) has been underwhelming. The one  thing that's really nice, though, is that I can easily add a variety of controls to the toolbars, as opposed to MFC or WinForms where there's all kinds of problems (probably stemming from ReBar itself). The really surprising thing is that googling for "sliding toolbar wpf" and similar keywords give me no hits talking about the problems I'm describing above. I can't imagine I'm the only one who's seeing this? Or am I really missing something big in the documentation?


    XNA/DirectX MVP 2006-present
    Saturday, February 7, 2009 11:41 PM

Answers

  • Hi,

     

    In terms of a floating ToolBar, you can create a Popup control to hold a ToolBar, then you control  the Popup’s behavior and position by setting the properties such as Placement ,PlacementTarget ,VerticalOffset. Here is a similar post about floating ToolBar. Just to clarify the detailed issue, could you please provide some sample code to demonstrate it ?

     

    Floating Toolbar link:

    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a6447d13-1668-4d23-8189-9d0994e4167f/

      

    Thanks.


    Jim Zhou -MSFT
    • Marked as answer by Jon Watte Friday, February 13, 2009 8:51 PM
    Friday, February 13, 2009 9:35 AM

All replies

  • Oh, and a fourth question: How do I float a toolbar into its own window? There doesn't appear to be some convenient function or property to do this, so I assume I'll have to detect dragging to a non-tray location (how?), and then create a floating window that has my main window as focus parent (how?), and properly move the toolbar object into that window (how?).


    XNA/DirectX MVP 2006-present
    Saturday, February 7, 2009 11:44 PM
  • Ah, well, I was hoping someone might know something about Toolbars, and stop by to share. No luck yet.

    Meanwhile, I can create a window with Tool Palette window style, and I can make it Frontmost, but I can't figure out the right magic to make focus behave the way it should for this palette wrt my main panel. When I click in the tool window, my regular window titlebar goes un-highlighted, so focus shifts to the tool palette itself. Any ideas about what to do about this?

    XNA/DirectX MVP 2006-present
    Sunday, February 8, 2009 10:55 PM
  • Hi,

     

    In terms of a floating ToolBar, you can create a Popup control to hold a ToolBar, then you control  the Popup’s behavior and position by setting the properties such as Placement ,PlacementTarget ,VerticalOffset. Here is a similar post about floating ToolBar. Just to clarify the detailed issue, could you please provide some sample code to demonstrate it ?

     

    Floating Toolbar link:

    http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/a6447d13-1668-4d23-8189-9d0994e4167f/

      

    Thanks.


    Jim Zhou -MSFT
    • Marked as answer by Jon Watte Friday, February 13, 2009 8:51 PM
    Friday, February 13, 2009 9:35 AM
  • The issue is simple: When I add toolbars to my WPF project, I want them to be on par with WinForms or MFC when it comes to moving, undocking and docking to different sides of the windows. You need no code to test that out; the plain defaults for each work fine. The toolbars in WPF feel like an early prototype by comparison.


    XNA/DirectX MVP 2006-present
    Friday, February 13, 2009 8:50 PM