Hi,
I have a UltraToolbarsManager with a several buttons and a ControlContainerTool that has a UltraTextEdtor as the contained control. I am using a UltraTextEditor so I can use the NullText property. The TextBoxTool does not seem to have the NullText property.This works fine except with tabbing. I can tab into the text editor, but when I tab to the next control, the text editor seems to lose focus, but I cannot tell what control is tabbed to. When I hit tab again the TextEditor receives the focus again. I set AcceptsTab to false, TabStop to true, and I set the tab index for the Text editor, but it does not seem to make a difference.
If I use the TextBoxTool, the tabbing seems to work, but I do not get the NullText functionality.
Is there a way to either get tabbing to work using a UltraTextEditor as the contained control?
Thanks
That's what appears to be happening in my testing. Not sure if that's something we can fix or handle in another way. But it doesn't appear that the ToolbarsManager is attempting to do anything special here beyond tabbing INTO the ControlContainerTool. It can do that since before press tab in that case, it's really the ToolbarDockArea control that contains the focus, so it can handle that, examine the next tool, see that it's a ControlContainerTool, and set focus to that control. Once focus is on that control, it becomes a lot trickier, since that control can be anything and it's not a control that's owned by or created by the ToolbarsManager. Which is not to say that it's impossible, only that we would have to look into it. It might be a good idea for us (Divya) to write that up in our system so we can investigate. But the point I was trying to get at here is that I'm not seeing the "tabbing to nowhere" behavior that you are describing. Are you seeing that behavior with my sample?
So If I understand what your are saying, Since I am using a UltraTextEditor control in the toolbar, the tabbing will go to the next control outside of the tool bar and not to the next tool in the tool bar.Is that correct?
So... the code you have here isn't really a good test, because there are no actual controls within the Panel to tab to. Any real application would have at least one control on the form that would be able to take focus. So I copied your code and placed a single button on the form (in the UltraPanel) and followed the steps you listed. In that case, what happens is that the Tab key moves from the UltraTextEditor to the Button and and back to the UltraTextEditor, essentially tabbing between controls. Which seems a little weird to me, but I'm not seeing the issue you described where the tab just goes nowhere (or at least nowhere visible). The toolbar can handle the tab key when a tool has focus, because the ToolbarsManager manages the tools and tools are not controls. But once you give focus to a control, the form kinda takes over. It might be something we could look into, but I'm not sure there's anything we can do about that. I have attached my sample here so you can see if you get the same results. WindowsFormsApp71.zip
I created a sample for you to look at.
I have a form with a UltraToolbarManager with one toolbarIn the toolbar are two StateButtons with an UltraTextEditor in a ControlContainerTool placed between the tool buttons.If I click on the first StateButton, the focus will be on that button. I can then tab to the UltraTextEditor. However, If I hit tab again, the second StateButton does not receive focus.
Here is some sample code that I am able to reproduce the issue with.
This is on a Form with a UltraPanel and a UltraToolbarsManager.The tools are added programatically.
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Create tools for the toolbar. StateButtonTool stateButton1 = new StateButtonTool("StateButton1"); StateButtonTool stateButton2 = new StateButtonTool("StateButton2"); UltraTextEditor textEditor1 = new UltraTextEditor() { Name = "TextEditor1", Width = 100, NullText = "Type here", }; // Create container for the text editor. ControlContainerTool editorContainerTool = new ControlContainerTool("EditorContainerTool"); stateButton1.SharedProps.Caption = "StateButton1"; stateButton1.SharedProps.DisplayStyle = ToolDisplayStyle.TextOnlyAlways; stateButton2.SharedProps.Caption = "StateButton2"; stateButton2.SharedProps.DisplayStyle = ToolDisplayStyle.TextOnlyAlways; // Configure text editor. textEditor1.NullTextAppearance.TextHAlign = Infragistics.Win.HAlign.Left; textEditor1.AcceptsTab = false; textEditor1.TabIndex = 999; textEditor1.AlwaysInEditMode = false; // Add text editor to the container. editorContainerTool.Control = textEditor1; // Create toolbar and Add tools the tool bars manager and the toolbar. ultraToolbarsManager1.Toolbars.AddToolbar("Toolbar1"); ultraToolbarsManager1.Tools.Add(stateButton1); ultraToolbarsManager1.Tools.Add(editorContainerTool); ultraToolbarsManager1.Tools.Add(stateButton2); // Add tool bar to manager and assign the tools the correct tool bar. ultraToolbarsManager1.Toolbars["Toolbar1"].Tools.InsertTool(0, "StateButton1"); ultraToolbarsManager1.Toolbars["Toolbar1"].Tools.InsertTool(1, "EditorContainerTool"); ultraToolbarsManager1.Toolbars["Toolbar1"].Tools.InsertTool(2, "StateButton2"); ultraToolbarsManager1.Toolbars["Toolbar1"].Tools["EditorContainerTool"].InstanceProps.IsFirstInGroup = true; ultraToolbarsManager1.Toolbars["Toolbar1"].Tools["StateButton2"].InstanceProps.IsFirstInGroup = true; }
What are the tools on? A Toolbar? A ribbon? A menu?
Also... how are you giving focus to the UltraTextEditor? Are you tabbing into it or clicking on it. Pressing Alt will activate the first tool on a Toolbar and then Tab should iterate over the tools on that Toolbar at that point. I tried this out and the tab order is a little weird, but I'm not losing the focus like you describe.