We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Change/edit the height of the command bar and reduce the docking area height at the top

Hi!  I would like ask if the area at the top of the form where the command bars/toolbars are docked is adjustable.  Specifically, I want to compress the height of the command bar and the dock area to be able to decrease the gap between command bar/toolbar and the next control.  Please see below as a sample illustration.



5 Replies

TB Thirupathi Bala Krishnan Syncfusion Team August 8, 2019 02:04 PM UTC

Hi San,

Thanks for contacting Syncfusion support.

We have analyzed the reported query –“How to decrease the height of command bar control”. Currently we don’t have any support to change the entire command bar controller. You can change the command bar height alone by doing the below changes in your application. But, the entire command bar controller height is unchangeable. Command bar controller is the container of command bar control. Please refer the screenshot for your understanding.  Here, the command bar(few buttons) height values are differed. But the container(entire) height values are not changed.
 

Before changing the height,

After changing the height value to 24,



Please refer the following code sample.

 
# Form1.cs

 
        private void Form1_Load(object sender, System.EventArgs e) 
        { 
            //Reset the in-built height value.       
            foreach (FieldInfo fi in commandBarStandard.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic)) 
            { 
                if (fi.Name.Contains("nCommandBarHt")) 
                { 
                    fi.SetValue(commandBarStandard, 24); 
                    break; 
                } 
            } 
            //Change the command bar height value 
            this.commandBarStandard.Height = 24; 
       } 
 
 
Sample link : https://www.syncfusion.com/downloads/support/forum/146560/ze/CommandBarsDemo-142670560

If we understood your actual requirement could you please share the detailed description about your requirement so that it could be helpful to provide the solution at the earliest.

Regards,
Thirupathi B.
 



SA San August 9, 2019 03:29 AM UTC

Thanks for the reply.  I get it that the commandbarcontroller height cannot be adjusted.  I was hoping that there was workaround that would enable me to compress the toolbar area so that I can maximize the space. The main app window design actually is a ribbonform with a tabbedmdimanager.  The childforms' design is the one I am trying to compress. 



For now I just removed the commandbar and put a panel instead so that I can manually adjust the height.  If there is a better way please do suggest one.

thanks..



JP Jagadeesan Pichaimuthu Syncfusion Team August 9, 2019 08:47 AM UTC

Hi San, 

Thanks for the update.

Yesterday We have missed to convey the information ‘Currently checked the possibilities to change the height value and will update the further details by tomorrow’. Sorry for the inconvenience caused. 
Now we have checked the way of possibilities to achieve the requirement “Change the height of command bar controller control”. You can achieve the same by changing the Height property of CommandDockBar. There is no need to replace the command bar control into panel. Could you please try the below code changes in your application and let me know the height was resized or not.

Before resizing the height value,



After resizing the height value,



Please refer the following code sample. 
# Form1.cs 
        private void Form1_Load(object sender, System.EventArgs e)  
        {  
            foreach (FieldInfo fi incommandBarStandard.GetType().GetFields(BindingFlags.Instance | BindingFlags.NonPublic))  
            {  
                if (fi.Name.Contains("nCommandBarHt"))  
                {                     
                   fi.SetValue(commandBarStandard, 24); 
                    break;  
                }  
            }  
            //Change the command bar height value  
            this.commandBarStandard.Height = 24; 
 
            //Change the command bar controller height value. 
            this.commandBarStandard.Parent.Height = 26; 
       }  
 

Sample link : https://www.syncfusion.com/downloads/support/forum/146560/ze/CommandBarDemo-1818888326

If the above solution does not meet your actual requirement, could you please share your detailed description about your requirement along with working sample, so that it could be helpful to provide the solution at the earliest.

Regards,
Jagadeesan



SA San August 17, 2019 12:40 AM UTC

Hi!  Tried this latest suggestion and I think it works.  I will tinker with it some more and feedback if there will be some other concerns.

Thanks again for the support!


JP Jagadeesan Pichaimuthu Syncfusion Team August 19, 2019 09:50 AM UTC

Hi San, 
 
Thanks for your update. 
 
We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Jagadeesan

Loader.
Live Chat Icon For mobile
Up arrow icon