in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Bar into Panel

Last post 10/27/2008 3:25 PM by Bruno Pacola. 5 replies.
Page 1 of 1 (6 items)
Sort Posts:
Previous Next
  • 10/24/2008 3:39 PM

    Bar into Panel

    Hi,

    I use ToolTrip native Visual Studio and I would like use Bar of BarManager..but this Bar don't move for into Panel (System.Windows.Forms.Panel), my Bar of BarManager only position top, left, right, bottom, standalone...

     

    I need help for position Bar into Panel...suggestion? I must use other control?

     

    THANKS!!!

    Filed under: , ,
  • 10/25/2008 1:57 PM In reply to

    Re: Bar into Panel

    Try deriving a sub-class of the XtraUserControl and place a BarManager and bars in that.  Your XtraUserControl object can then be placed in a panel, tab page, etc.
     
  • 10/25/2008 5:29 PM In reply to

    Re: Bar into Panel

    your idea is good, but how i create buttons and action events in my form where usercontrol into?

    Thanks! =)

     

    This is very urgent! thanks!!

  • 10/26/2008 10:25 AM In reply to

    Re: Bar into Panel

    I usually handle those events in the user control that contains the menu/tool bar.
     
    If necessary to handle events within the form that contains the user control, you could create your own events within your user control and raise those when a menu/tool button is clicked.  In each ItemClick event handler method, raise your own event and pass it the necessary parameters.  Bind the form to your user control's events.
     
    Another possibility is to make the objects accessible outside of the user control so that the form could bind to their events directly after the user control has been placed on the form.  Not necessarily a best practice but possible by changing each BarItem object's Modifers from Private to Public.  The re-raising of an event approach described above is a better approach.
     
  • 10/26/2008 10:50 AM In reply to

    Re: Bar into Panel

    Here is an example.
     
    I have a XtraUserControl subclass named ToolPanel.  Contained in this ToolPanel is a SimpleButton named sizingButton.  I handle its Click event as follows within the ToolPanel class to toggle its window state.
    ___________
     
        private void sizingButton_Click( object sender, EventArgs e )
        {
            ToggleWindowState();
        }
     
        private static FormWindowState panelWindowState = FormWindowState.Normal;
        public static FormWindowState PanelWindowState
        {
            get { return panelWindowState; }
            set { panelWindowState = value; }
        }
     
        protected virtual void ToggleWindowState()
        {
            if( ToolPanel.PanelWindowState == FormWindowState.Maximized )
                ToolPanel.PanelWindowState = FormWindowState.Normal;
            else
                ToolPanel.PanelWindowState = FormWindowState.Maximized;
     
            OnSizingPanel();
            Focus();
        }
    ___________
     
    I declared an event within my ToolPanel class named SizingPanel.  The OnSizingPanel method invoked by the ToggleWindowState method shown above raises my event.  It looks like this.
    ___________
     
        public static event EventHandler SizingPanel;
     
        protected void OnSizingPanel()
        {
            EventHandler handler = SizingPanel;
            if( handler != null )
                handler( this, EventArgs.Empty );
        }
    ___________
     
    In my main form (which might contain several instances of a ToolPanel), I bind a handler method to the SizingPanel event within the form's constructor as follows.
    ___________
     
        ToolPanel.SizingPanel += new EventHandler( ToolPanel_SizingPanel );
    ___________
     
    Within the form's ToolPanel_SizingPanel method, I hide or show DockPanel objects so that the ToolPanel objects will appear maximized or restored, depending on the ToolPanel.PanelWindowState value that was toggled before the event was raised.
     
    The SimpleButton.Click event handler could just as easily been a BarItem.ItemClick event handler.  Instead of an empty EventArgs object being passed to the custom event, the ItemClickEventArgs parameter of the ItemClick event could be passed along to the custom event.  The sender parameter of the custom event could still be a reference to the user control that contains the menu/tool bar.
     
    Let me know if you need additional information.
  • 10/27/2008 3:25 PM In reply to

    Re: Bar into Panel

    ksHi friend!! Thanks! In Documentation get response my question!!

    See:

    ms-help://DevExpress.NETv8.2/DevExpress.XtraBars/CustomDocument1085.htm

    (Standalone Bar Dock Control)

     

Page 1 of 1 (6 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED