Dom said:
[...]
So back to square 1, and some other questions. "...putting an textbox
over the area where the tab is ..." How do I find that area? [...]
Unfortunately, I know of only two ways to do that. One is unreliable
and easy. The other is reliable and more difficult.
Easy: just line the controls up in the Designer and hope for the best.
Even resolution/font-size changes can mess that up, and of course if the
control itself changes in the future, the alignment may no longer work.
More difficult: implement your own tab control. The fact is, it's not
actually _that_ complicated a control, but custom controls are not
everyone's "cup of tea", and the tab control certainly involves some
extra work as compared to less dynamic controls. But if you implement
your own tab control, then obviously you can include whatever features
you want, including editable tab names.
And then there's a third, intermediate approach that occurs to me. I'm
not actually sure exactly how one would go about it, but if you can find
a way to intercept the drawing of the tab caption at run-time, then you
can inspect the location of the drawing and use that to position an edit
control at the times you need to.
Personally, I would just display a dialog to let the user change the
name. The in-place effect in Excel is cool, but it's not really adding
much utility to the UI. If you were already having to re-implement the
tab control yourself for other reasons, then it'd probably be a fun
feature to include. But to re-implement the control _just_ for that
feature seems like serious overkill to me.
Pete
- Show quoted text -