Hi,
We are using Smart Client Software Factory, and UltraTabWorkspace. And our Form is opened in a TabWorkspace.
For example, there is a DataGrid, and a row is selected, when user double click it, a new tab will open, and the user can close the new tab, then the previous tab will be actived, but the focus will be on the title of tab, then the original focused row lost the focus. Our end user complains that it's very hard to use.
Is there any way to keep the original focus when a tab got focus? Compare to the IE7, we found it will not set the focus to tab header, and if I inputed something in the form, the focus will still be there when switching between tabs.
Thanks.
I'm not sure exactly what you're asking but I believe you want the original grid row to be focused when the focus returns to the grid. When I want that to happen I store the row ID in a variable and loop through the rows and activate when the row ID matches the saved value.
I can open multiple tabs, and do some works in each tab, then I may place the cursor in different controls for each tab. What I want is too keep the cursor not changed when switching tabs. At this moment, the focus will move to tab header, the the original control hold the focus will lost the focus.
About the selected row in datagrid is another sample, maybe more complicated.
You will need to manually track the last control with focus. You might want to define a member variable for the last control with focus, then handle the Leave event for the controls on the tabs. When the event fires, set the member variable to the control which fired it.
Another member variable on your form should be a dictionary where the key is of type UltraTab and the value is of type Control. Then handle the SelectedTabChanged event for the tab control. If your member variable for the last control with focus is not null, store an entry in your dictionary. The key should be the PreviousSelectedTab on the event args and the value should be the last control with focus. Then in the same event handler, check to see if the dictionary has an entry for the SelectedTab property on the tab control. If so, get the value from the dicationary and call Focus() on it.