|
-
Jul 19th, 2010, 03:34 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] Close Tab Button on tab: Is it possible?
Is it possible to get a little X on a tab like this

I can do the removing the tab part myself but i dont know if its possible and if it is how to put a button on a tab.
Thankyou in advance
-
Jul 19th, 2010, 03:46 PM
#2
Re: Close Tab Button on tab: Is it possible?
You have to custom-draw the tabs... I think I saw a CodeBank entry, but maybe not.
You could also use my custom-draw XTabControl but it doesn't work very well unless you add controls at runtime, not design time (it turns out that locking them makes it so you can't put controls in them...).
-
Jul 19th, 2010, 03:53 PM
#3
Thread Starter
Fanatic Member
Re: Close Tab Button on tab: Is it possible?
Can you point me in the way of this XtabControl please, as i am already adding controls at runtime on Load
-
Jul 19th, 2010, 03:55 PM
#4
Re: Close Tab Button on tab: Is it possible?
Oh, good 
Here it is. You'll need to create a new header renderer (I explain how in the thread), then handle some events.
Post 14 is the tutorial.
-
Jul 20th, 2010, 01:54 AM
#5
Re: Close Tab Button on tab: Is it possible?
Hi,
You can find a tutorial how to create a Owner drawn Tabcontrol, here.
-
Jul 20th, 2010, 02:01 AM
#6
Re: Close Tab Button on tab: Is it possible?
Yet another useful link for the TabControl:
http://dotnetrix.co.uk/tabcontrol.htm
-
Jul 20th, 2010, 04:28 AM
#7
Re: Close Tab Button on tab: Is it possible?
I also know of several free third party tabcontrols that have close buttons, but I can't find them anymore so quickly. Shouldn't be too hard to find though. One thing I noticed is that none of them really look very good, and none of them use the windows theme that the user is using at that time. I've searched around for a bit and I can't figure out how to draw a tab header in the system theme style. I don't think it's possible
-
Jul 21st, 2010, 06:27 AM
#8
Re: Close Tab Button on tab: Is it possible?
You may have a look at my codebank article that does exactly this:
TabControl with Close button on TabPages (with Design-Time support)
Let me know if you have any concerns.
-
Jul 21st, 2010, 03:14 PM
#9
Thread Starter
Fanatic Member
Re: Close Tab Button on tab: Is it possible?
I have done this using the drawing method from post 5, thankyou all guys anyway
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|