Hi All,
Is it possible for a user to rename a tab? I know I can do it programmatically using Tab.text, but I'm looking for a way of the existing tab text getting selected/highlighted, and then the user being able to type a new name over the top.
Just like in MS Excel, when the user clicks on a sheet tab and chooses "Rename".
Is this acheivable, and if not, what is a good alternative for handling user tab renaming?
Any info appreciated,
Scott Pearce
Hi all,
This worked brilliantly, thanks!!!
Just a quick note, I wanted to go one step further by allowing the user to be able to add a tab and then immediately go into edit mode. I initially had prolems in that the tabControl.UIElement.GetDescendant(typeof(TabItemUIElement), myNewTab) was returning a null. To resolve this, I had to refresh the tabControl (myTabControl.Refresh()) immediately after adding my new tab and before attempting to go into edit mode.
Hope this helps.Assad
i figured it out... the textbox should be created outside the ultratabcontrol
Hi.
I just tried to apply the code, the problem i have is that the ultratexteditor is behind the tab and i cant get it to the front.
any suggestions? thx
Mike Dour"]Not bad. The only suggestion I'll make is that you use the following code to find a tab's rect so you don't have to do so much work manually searching for the edges: UIElement tabElement = this.tabAddress.UIElement.GetDescendant( typeof( TabItemUIElement ), tab ); if ( tabElement != null ){ Rectangle tabRect = tabElement.Rect; // ...}
Not bad. The only suggestion I'll make is that you use the following code to find a tab's rect so you don't have to do so much work manually searching for the edges:
UIElement tabElement = this.tabAddress.UIElement.GetDescendant( typeof( TabItemUIElement ), tab );
if ( tabElement != null ){ Rectangle tabRect = tabElement.Rect; // ...}
Awsome.....I didn't know about that UIelement thing...I am still only a couple of onion layers deep in the Infra stuff
CW