Hi,
I am using a UltraExplorerBar with ControlContainer enabled. To allow users to trigger button click in the control I am setting the mainform.Acceptbutton to the Control.Button1 which is added to the ControlContainer.
Setting of AcceptButton in NavigationPaneExpanded event allows the triggering of acceptbutton in the NavigationPane when in Expanded mode.
But this does not work when the NavigationPane is in Flyout mode when setting the acceptbutton in the NavigationPaneFlyoutDisplayed event.
Any help will be appreciated.
- Avinash
Hello,
I have created a sample, based on your description, and try to reproduce the behavior that you mentioned, but without success. You could find the attached sample. Please run the sample, click on “Navigation Pane” , then click on “button1” and see the “OutPut List” next to the UlttraExplorerBar. You will see that OnClick event of the button is fired when UlttraExplorerBar is in FlyoutMode. Please feel free to modify my sample to illustrate the issue that you are experiencing.
I am waiting for your response.
Hi Hristo,
Thanks for the reply. Let me explain in detail.
I have ultraExplorerBar in my app. I add custom controls to the ultraExplorerBar.Groups programmatically.These custom control are user form that needs to be filled and then submitted.
To help the user to avoid using mouse to fill these forms, I set focus to the first textbox in the form. And set the MainForm.AcceptButton to this form.I am using the acceptbutton(Form.AcceptButton) of the mainform to the control that is shown in the explorerbar. This way if I press enter the button of the control displayed gets triggered.
This needs to be done if new UltraExplorerBarGroup is added or selection changes among the groups or navigationpane expanded.
The below is some part of the code that does the setting of focus and acceptbutton.
private void ultraExplorerBar_NavigationPaneExpanded(object sender, EventArgs e){ if (this.ultraExplorerBar.SelectedGroup != null) { ILauncher launcher = this.ultraExplorerBar.SelectedGroup.Container.Controls[0] as ILauncher; if (launcher != null) { this.AcceptButton = launcher.AcceptButton; //this is the MainForm launcher.InitialFocus(); }
}
Everything works fine for all the above cases. The issue is when the NavigationPane is Collapsed and I click the NavigationBar which triggers the NavigationPaneFlyout. In this case if I try to set the focus and the acceptbutton using the ultraExplorerBar_NavigationPaneFlyoutDisplayed the acceptbutton does not work, the control.button is not triggered.
I am not sure that I completely understand your scenario.In order to try to reproduce this behavior at my end could you please provide me more details like steps that I have to follow in order to able to reproduce it. If you could provide me a small sample that illustrates this behavior it would be helpful for me to understand better the issue that you are describing.
I am waiting for your details.