XPToolbar in sfForm's TitleBarTextControl?

Can I put an XPToolbar in an SfForm's TitleBar using the TitleBarTextControl property? There's a lot of wasted space in the Titlebar and modern designs (like Visual Studio, etc.) use the titlebar space for the menu.

Thanks,


1 Reply

SP Sreemon Premkumar Muthukrishnan Syncfusion Team July 10, 2023 04:34 PM UTC

Hi Paul,

Yes, your requirement “To load the XPToolBar control in the SfForm title bar” can be achieved by using the SfForm.TitleBarTextControl property. Please find the code snippet.


XPToolBar xPToolBar = new XPToolBar();

BarItem File = new BarItem() { Text = "File", };

File.Click += File_Click;

BarItem Edit = new BarItem() { Text = "Edit" };

Edit.Click += Edit_Click;

BarItem View = new BarItem() { Text = "View" };

View.Click += View_Click;

BarItem Git = new BarItem() { Text = "Git" };

Git.Click += Git_Click;

ParentBarItem parentBarItem = new ParentBarItem() { Text = "Project" };

BarItem Build = new BarItem() { Text = "Build" };

BarItem Debug = new BarItem() { Text = "Debug" };

BarItem Analyze = new BarItem() { Text = "Analyze" };

BarItem Test = new BarItem() { Text = "Test" };

BarItem Tools = new BarItem() { Text = "Tools" };

BarItem Extensions = new BarItem() { Text = "Extensions" };

BarItem Window = new BarItem() { Text = "Window" };

BarItem Help = new BarItem() { Text = "Help" };

xPToolBar.Items.Add(File);

xPToolBar.Items.Add(Edit);

xPToolBar.Items.Add(View);

xPToolBar.Items.Add(Git);

xPToolBar.Items.Add(Build);

xPToolBar.Items.Add(Debug);

xPToolBar.Items.Add(Analyze);

xPToolBar.Items.Add(Test);

xPToolBar.Items.Add(Tools);

xPToolBar.Items.Add(Extensions);

xPToolBar.Items.Add(Window);

xPToolBar.Items.Add(Help);



We have prepared the sample based on your requirement. Please find it in the attachment.


Attachment: SfformLoadingXPtoolBar_ec58b4f.zip

Loader.
Up arrow icon