Hello,
I'm using an UltraTabControl to manage different UserControls in an Application. The switching between the tabs is mostly controlled by the application. Therefore I'm searching a way to hide the tab header. Is this possible?
Thank you!
Frank
You can set the Style property on the UltraTabControl to Wizard.
Is there a way to disable the default Ctrl+Tab behavior while in Wizard mode?
If I created a blank project, add an UltraTabcontrol with three tabs and a command button on each. I can hit ctrl + tab when the button has focus and the control will move to the next tab.
The following code will remove the key action mappings for Ctrl+Tab and Ctrl+Shift+Tab from an UltraTabControl:
List<KeyActionMappingBase> mappingsToRemove = new List<KeyActionMappingBase>();foreach ( KeyActionMappingBase mapping in this.ultraTabControl1.KeyActionMappings ){ if ( mapping.KeyCode == Keys.Tab ) { if ( mapping.SpecialKeysRequired == SpecialKeys.Ctrl || mapping.SpecialKeysRequired == SpecialKeys.ShiftCtrl ) { mappingsToRemove.Add( mapping ); } }}
foreach ( KeyActionMappingBase mapping in mappingsToRemove ) this.ultraTabControl1.KeyActionMappings.Remove( mapping );
You can use this in the constructor of your Form after the InitializeComponent call.
Thank you very much for the reply.
I tried using the code snippit you gave me to my sample project, but I did not have any success. As requested, I put the snippit in after the IntializeComponent of the form. I was still able to Ctrl+Tab to the next Tab.
I removed the if statements so that the code would remove all mappings and it still didn't work.
I created button Click event for one of the buttons on the TabControl and got a Count on KeyActionMappings. It was zero (this was for the code that removed all key mappings). Yet I was still able to press Ctrl+Tab to move to the next tab.
Is there some other property I should set on the ultra tab to make this work?
Hi,
Thanks a lot !!!
I've tried and that code works :
public partial class UltraTabControlKM : UltraTabControl{ private Keys fKeysTabControl = Keys.Control | Keys.Tab; private Keys fKeysTabControlShift = Keys.Control | Keys.Tab | Keys.Shift; public UltraTabControlKM() { InitializeComponent(); } public UltraTabControlKM(IContainer container) { container.Add(this); InitializeComponent(); } //Surcharge pour corriger le bug protected override bool ProcessDialogKey(Keys keyData) { if (keyData == fKeysTabControl || keyData == fKeysTabControlShift) { return false; } else { return base.ProcessDialogKey(keyData); } }}
ps : Starfox was so good on GC...
Hello ,
If you cannot use the latest service release of Infragistics then you could try the following workaround:
class UltraTabControlKM: UltraTabControl
{
Keys fKeysTabControl = Keys.Control | Keys.Tab ;
Keys fKeysTabControlShift = Keys.Control | Keys.Tab | Keys.Shift ;
public UltraTabControlKM(IContainer container)
container.Add(this);
}
protected override void OnKeyDown(KeyEventArgs e)
if (e.KeyData == fKeysTabControl || e.KeyData == fKeysTabControlShift)
return;
base.OnKeyDown(e);
Please let me know if you have nay further questions.
Hi, do you have a solution for that ?
Hi, we will not have the last version of Infragistics before many weeks and I try the overriding method but I don't know how to identify the ctrl+Tab or ctrl+shift+tab in System.Windows.Forms.Keys format :
Thanks.
I recently looked into this issue and implemented a fix which will be available in the next hotfix. In the meantime, you can work around this issue by using a derived UltraTabControl and overriding ProcessDialogKey. If the passed in key is Ctrl+Tab or Ctrl+Shift+Tab, return False.