Set color of TabControl Border

T

Tamir Khason

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
 
J

Jeffrey Tan[MSFT]

Hi Tamir,

Thanks for posting in this group.
What does your "access those properties,not supported by standart
interface" mean?
The TabControl in .Net exposes the owner-draw interface for you. You can
handle DrawItem event of TabControl.
Also, you can override certain protected methods of this control.
You can override the WndProc method of TabControl or TabPage, then you can
hook some messages of this control.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| Subject: Set color of TabControl Border
| Date: Thu, 13 Nov 2003 20:59:38 +0200
| Lines: 9
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199101
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| 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
|
|
|
 
J

Jeffrey Tan[MSFT]

Hi Tamir,

I think MSDN provides you a quick start of the usage and reference of these
methods.
For example, you can find the tabcontrol's Drawitem event usage in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformstabcontrolclassdrawitemtopic.asp

You also can learn how to hook the message of tabcontrol in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformscontrolclasswndproctopic.asp

There are also many samples in internet, you can search these keyword in
www.google.com.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Set color of TabControl Border
| Date: Sun, 16 Nov 2003 17:05:22 +0200
| Lines: 57
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 213.8.78.114
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199678
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Have you good references for those methods/??
|
|
| | >
| > Hi Tamir,
| >
| > Thanks for posting in this group.
| > What does your "access those properties,not supported by standart
| > interface" mean?
| > The TabControl in .Net exposes the owner-draw interface for you. You can
| > handle DrawItem event of TabControl.
| > Also, you can override certain protected methods of this control.
| > You can override the WndProc method of TabControl or TabPage, then you
can
| > hook some messages of this control.
| >
| > Hope this helps,
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Tamir Khason" <[email protected]>
| > | Subject: Set color of TabControl Border
| > | Date: Thu, 13 Nov 2003 20:59:38 +0200
| > | Lines: 9
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: 198.211.173.74
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:199101
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | 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
| > |
| > |
| > |
| >
|
|
|
 
T

Tamir Khason

That's fine. I already saw it. However I need a way to change border color
of TabPage inside TabControl without using Windows XP additions (to make it
cross-windows) control...

Thankx



"Jeffrey Tan[MSFT]" said:
Hi Tamir,

I think MSDN provides you a quick start of the usage and reference of these
methods.
For example, you can find the tabcontrol's Drawitem event usage in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformstabcontrolclassdrawitemtopic.asp

You also can learn how to hook the message of tabcontrol in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemwindowsformscontrolclasswndproctopic.asp

There are also many samples in internet, you can search these keyword in
www.google.com.

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Set color of TabControl Border
| Date: Sun, 16 Nov 2003 17:05:22 +0200
| Lines: 57
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 213.8.78.114
| Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
8.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199678
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| Have you good references for those methods/??
|
|
| | >
| > Hi Tamir,
| >
| > Thanks for posting in this group.
| > What does your "access those properties,not supported by standart
| > interface" mean?
| > The TabControl in .Net exposes the owner-draw interface for you. You can
| > handle DrawItem event of TabControl.
| > Also, you can override certain protected methods of this control.
| > You can override the WndProc method of TabControl or TabPage, then you
can
| > hook some messages of this control.
| >
| > Hope this helps,
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Tamir Khason" <[email protected]>
| > | Subject: Set color of TabControl Border
| > | Date: Thu, 13 Nov 2003 20:59:38 +0200
| > | Lines: 9
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: 198.211.173.74
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:199101
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | 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
| > |
| > |
| > |
| >
|
|
|
 
J

Jeffrey Tan[MSFT]

Hi Tamir,

For example, you can first get the rectangle of the tabpage, then draw the
frame to it.
private void tabControl1_DrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)
{
Graphics g = e.Graphics;
Pen p = new Pen(Color.Blue,4);
g.DrawRectangle(p,this.tabPage1.Bounds);
}

Hope this helps,
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

--------------------
| From: "Tamir Khason" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
| Subject: Re: Set color of TabControl Border
| Date: Mon, 17 Nov 2003 13:12:01 +0200
| Lines: 124
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.csharp
| NNTP-Posting-Host: 198.211.173.74
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:199814
| X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
|
| That's fine. I already saw it. However I need a way to change border color
| of TabPage inside TabControl without using Windows XP additions (to make
it
| cross-windows) control...
|
| Thankx
|
|
|
| | >
| > Hi Tamir,
| >
| > I think MSDN provides you a quick start of the usage and reference of
| these
| > methods.
| > For example, you can find the tabcontrol's Drawitem event usage in:
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
| > frlrfsystemwindowsformstabcontrolclassdrawitemtopic.asp
| >
| > You also can learn how to hook the message of tabcontrol in:
| >
|
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
| > frlrfsystemwindowsformscontrolclasswndproctopic.asp
| >
| > There are also many samples in internet, you can search these keyword in
| > www.google.com.
| >
| > Hope this helps,
| > Best regards,
| > Jeffrey Tan
| > Microsoft Online Partner Support
| > Get Secure! - www.microsoft.com/security
| > This posting is provided "as is" with no warranties and confers no
rights.
| >
| > --------------------
| > | From: "Tamir Khason" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Set color of TabControl Border
| > | Date: Sun, 16 Nov 2003 17:05:22 +0200
| > | Lines: 57
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | NNTP-Posting-Host: 213.8.78.114
| > | Path:
| >
|
cpmsftngxa06.phx.gbl!TK2MSFTNGXA06.phx.gbl!TK2MSFTNGXA05.phx.gbl!TK2MSFTNGP0
| > 8.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.languages.csharp:199678
| > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > |
| > | Have you good references for those methods/??
| > |
| > |
| > | | > | >
| > | > Hi Tamir,
| > | >
| > | > Thanks for posting in this group.
| > | > What does your "access those properties,not supported by standart
| > | > interface" mean?
| > | > The TabControl in .Net exposes the owner-draw interface for you. You
| can
| > | > handle DrawItem event of TabControl.
| > | > Also, you can override certain protected methods of this control.
| > | > You can override the WndProc method of TabControl or TabPage, then
you
| > can
| > | > hook some messages of this control.
| > | >
| > | > Hope this helps,
| > | > Best regards,
| > | > Jeffrey Tan
| > | > Microsoft Online Partner Support
| > | > Get Secure! - www.microsoft.com/security
| > | > This posting is provided "as is" with no warranties and confers no
| > rights.
| > | >
| > | > --------------------
| > | > | From: "Tamir Khason" <[email protected]>
| > | > | Subject: Set color of TabControl Border
| > | > | Date: Thu, 13 Nov 2003 20:59:38 +0200
| > | > | Lines: 9
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.languages.csharp
| > | > | NNTP-Posting-Host: 198.211.173.74
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.languages.csharp:199101
| > | > | X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
| > | > |
| > | > | 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
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top