473,382 Members | 1,392 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Tabcontrol tabpage indented canvas

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
2 2823
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Tamir Khason | last post by:
How be able to manage more deeply UI of TabControl and TabPage For example - I want to manage border color, change color of TabPage reef, eliminate spaces from both sides of the reef, so I bould...
3
by: cdj | last post by:
Hi all, I've got a tabControl, initially with one tabPage, along with two buttons, one to add another tabPage, and one to delete the current (selected) tabPage. On each tabPage, when it is...
5
by: meh | last post by:
New to C#... I have a tab page with a handful of controls on it (label, combobox, etc.). Is it possible to "boilerplate a tabPage with the controls "like a MDI childForm" so that adding a new...
2
by: Francois Vanderseypen | last post by:
Can someone tell me why you cannot drag something onto a tabcontrol with zero tabpages? I have a kind of 'docking' interface and relies heavily on GDI+, a screenshot is available here: ...
1
by: RA | last post by:
Hi 1) I want to create a TabPage class in design mode - how do I do it? What type of project should I use? Is it going to be a custom control? 2) I have a TabControl that I would like to add to...
2
by: Richard | last post by:
Hi, Simple tabcontrol question: I have a tab control with a number of tabpages on it. What I want is to show a particular tabpage when I click a button that is not on the tabcontrol. Can...
0
by: Gianluca | last post by:
Hi All, i'm experencing a frustrating and strange behaviaour : I created a Windows project in VB.NET 2003 with a form and then I added a TabControl on the form, and added 5 TabPages on...
9
by: Michael Turner | last post by:
Hi Guys Having problem with the tab control, I need to set the background color to something different than the standard, I have found code on the web and now can redraw the tabpage buttons so...
0
by: =?Utf-8?B?TWFydGluIw==?= | last post by:
Hello everybody! Please note that I have posted same question in different forums with no success. So If you tried to help me there, please do not consider the repost as rude! I'm working on...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.