Direct Edit of TabPage Text During runtime?

04-03-2006, 08:44 AM
Hello Everyone,

I have looked around and couldn't find an elegant solution similar to Excel's Worksheet tab text rename/edit method.

Currently I New a textbox over the tab and dispose it on lostfocus and enter/esc key. This works OK but is not quite as elegant as Excel's implementation.

I believe the correct code would reside in the DrawItem event (w/ the control set to OwnerDrawFixed)

Anyone seen something like this? Or could point me in the right direction?

Thank you!

Best Regards,

04-07-2006, 10:46 AM
I may be wrong, but if you want to ownerdraw the editing of Tab title text yourself, the draw proc. should take care of at least the following situations:
1. when editing begins.
2. the blinking cursor and its position.
3. selection/selected text.
4. when editing ends.

BTW, why is your New Textbox method not elegant?

04-20-2007, 01:48 PM
Wow I am digging this one up from the past but the code is still the same in my project and I would love to improve it.

IUknown - IMO The New Textbox is not elegant due to the fact that I have to instantiate and dispose of a control to enable dynamic changing of tabpage text.

It does seem somewhat trivial I agree.

But Excel allows what seems to be direct editing of the tabpage's text. At least it appears to allow direct editing. I suppose MS could be hiding the text box if they are using the same method I am (I highly doubt it).

I have used paint to draw text onto surfaces is this what you are referring to above? Sorry but I have looked around for someone who has attempted this or something similar.

Oh well almost a year later and I still have the New Textbox functioning and happy. Maybe I should let dead dogs lie.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum