473,791 Members | 2,807 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
programmaticall y 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 2844
Inherit from TabControl and override the DisplayRectangl e.

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

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

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rex the Strange" <ro********@wid getinc.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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
programmaticall y 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 DisplayRectangl e.

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

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

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Rex the Strange" <ro********@wid getinc.comwrote in message
news:11******** **************@ m73g2000cwd.goo glegroups.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
programmaticall y 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
18511
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 custom control that inherit all information from TabPage, but how to access those properties, not supported by standart interface??? Thank you
3
2260
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 created, is an pictureBox. Other stuff on the form leads to the creation of a graphic, say myImage, which I would like to assign to the pictureBox.Image property
5
2019
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 tabPage includes the controls. Any examples, documentation or comments would be helpful. tia meh
2
2348
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: http://netron.sourceforge.net/Biotron3Shot.jpg You can move tab pages in the different panes, unless it's totally empty (TabCount=0). Is there an alternative? Thanks a lot,
1
7652
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 it the TabPage created in step 1. I don't want to draw the TabPage on the Tabcontrol in design mode, but to have a few TabPage controls that I candynamicaly load to the TabControl at runtime. Thanks
2
2838
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 anyone tell me how I would code this? Thanks Richard
0
1168
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 TabControl. then I added some controls (button, picturebox,labels, ... ) on each TabPage. close the form and open it again. Now when I click TabControl to go to any tab page and right click on any control (button, label, picture,..) , I can only see...
9
3458
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 the are set to the right color, I can obviously change the tabpage colour but I am left with a grey top edge(Where there are no buttons) when the background of the form is changed any ideas on what I can do? Mike.
0
2362
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 an application which has UserControls (GUI pages) with TabControls on it. This TabControls are Usercontrols derived from Windows.Forms.TabControl. Same to TabPage.
0
9515
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10426
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9993
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7537
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5558
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4109
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2913
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.