By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,870 Members | 1,224 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,870 IT Pros & Developers. It's quick & easy.

Tabcontrol tabpage indented canvas

P: n/a
I suspect the answer to this question is "you can't," but here goes
anyway:

I have a tabcontrol which contains, of course, various tabpages (added
programmatically at runtime, but this is irrelevent to the question).
I've noticed, however, that the actual drawing canvas of the tabpage is
not flush with the edge of the tabpage. There is always a small one
pixel border on the top, right and bottom and a three pixel border on
the left. So, when I put my custom control on the page and dock it to
full there's always this ugly white line around it.

How do I get rid of that? I've tried adjusting padding and margins of
all controls and nothing seems to work. Is this impossible? Does it
require manually redrawing the tabpage and component (god, I hope not).

tia
rts

Oct 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Inherit from TabControl and override the DisplayRectangle.

using System;
using System.Drawing;
using System.Windows.Forms;

namespace MyNameSpace
{
public class MyTabControl : TabControl
{
public override System.Drawing.Rectangle DisplayRectangle
{
get
{
Rectangle r = base.DisplayRectangle;
r.Inflate(2, 1);
r.Offset(-1, 0);
return r;
}
}
}
}

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rex the Strange" <ro********@widgetinc.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
>I suspect the answer to this question is "you can't," but here goes
anyway:

I have a tabcontrol which contains, of course, various tabpages (added
programmatically at runtime, but this is irrelevent to the question).
I've noticed, however, that the actual drawing canvas of the tabpage is
not flush with the edge of the tabpage. There is always a small one
pixel border on the top, right and bottom and a three pixel border on
the left. So, when I put my custom control on the page and dock it to
full there's always this ugly white line around it.

How do I get rid of that? I've tried adjusting padding and margins of
all controls and nothing seems to work. Is this impossible? Does it
require manually redrawing the tabpage and component (god, I hope not).

tia
rts

Oct 5 '06 #2

P: n/a
Brilliant! Thanks.

Got any suggestions for my problem posted here?
http://groups.google.com/group/micro...4f89bfe6e97eb0

Probably something similar but in this case I can't inherit.

rts.

Mick Doherty wrote:
Inherit from TabControl and override the DisplayRectangle.

using System;
using System.Drawing;
using System.Windows.Forms;

namespace MyNameSpace
{
public class MyTabControl : TabControl
{
public override System.Drawing.Rectangle DisplayRectangle
{
get
{
Rectangle r = base.DisplayRectangle;
r.Inflate(2, 1);
r.Offset(-1, 0);
return r;
}
}
}
}

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rex the Strange" <ro********@widgetinc.comwrote in message
news:11**********************@m73g2000cwd.googlegr oups.com...
I suspect the answer to this question is "you can't," but here goes
anyway:

I have a tabcontrol which contains, of course, various tabpages (added
programmatically at runtime, but this is irrelevent to the question).
I've noticed, however, that the actual drawing canvas of the tabpage is
not flush with the edge of the tabpage. There is always a small one
pixel border on the top, right and bottom and a three pixel border on
the left. So, when I put my custom control on the page and dock it to
full there's always this ugly white line around it.

How do I get rid of that? I've tried adjusting padding and margins of
all controls and nothing seems to work. Is this impossible? Does it
require manually redrawing the tabpage and component (god, I hope not).

tia
rts
Oct 5 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.