TabControlAdv - showing the tab list programmatically

Hi -
I want to provide a keyboard shortcut for the user to display the list of tabs in the upper right hand corner. Is there a way to programmatically show this list?
Thanks,
Julie


2 Replies

JL Julie Levy June 19, 2008 04:53 PM UTC


Just to clarify, i'm trying to find a way to programmatically open the PrimitiveTab dropdown.


>Hi -
I want to provide a keyboard shortcut for the user to display the list of tabs in the upper right hand corner. Is there a way to programmatically show this list?
Thanks,
Julie





FS Fathima Shalini P Syncfusion Team June 26, 2008 03:48 AM UTC

Hi Julie,

Thank you for your interest in Syncfusion Products.

If your intention is to provide a keyboard shortcut to programmatically open the primitive tab drop down, it is not possible with default drop down. As a work around we can add ContextMenuStrip and show it when we click the drop down or when we press Ctrl+A. Please refer the below code snippet that illustrates this:


private void tabControlAdv1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == (Keys.Control | Keys.A))
this.contextMenuStrip1.Show(this.tabControlAdv1, new Point(this.tabControlAdv1.TabPrimitivesHost.Location.X,this.tabControlAdv1.TabPrimitivesHost.Location.Y+10));
}

private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
if(this.contextMenuStrip1.Items!=null)
this.contextMenuStrip1.Items.Clear();
foreach (TabPageAdv tabpageAdv in this.tabControlAdv1.TabPages)
{ this.contextMenuStrip1.Items.Add(tabpageAdv.Text);
}
}


Please refer the below sample that illlustrates this:

http://websamples.syncfusion.com/samples/Tools.Windows/F74548/main.htm

Please let me know if any concerns.

Regards,
Fathima


Loader.
Up arrow icon