PC Review


Reply
Thread Tools Rate Thread

How to change the borderColor for a panel control

 
 
sajin
Guest
Posts: n/a
 
      6th Jun 2006
Hi,

I am using VB .net 2005 to create my windows form application , i have
a panel control in my main form , i want to change the border color of
the panel to red color , could any one help me to resolve this problem

Thanks in advance
Sajin

 
Reply With Quote
 
 
 
 
Jared
Guest
Posts: n/a
 
      6th Jun 2006
PANEL INSIDE PANEL WITH PADDING OF 1,1,1,1

oops, caps lock on

"sajin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using VB .net 2005 to create my windows form application , i have
> a panel control in my main form , i want to change the border color of
> the panel to red color , could any one help me to resolve this problem
>
> Thanks in advance
> Sajin
>



 
Reply With Quote
 
Tim Wilson
Guest
Posts: n/a
 
      6th Jun 2006
You can set the BorderStyle of the Panel to None, and then add an event
handler for the Paint event and draw a border in whatever color, thickness,
or pattern that you'd like.

--
Tim Wilson
..NET Compact Framework MVP

"sajin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I am using VB .net 2005 to create my windows form application , i have
> a panel control in my main form , i want to change the border color of
> the panel to red color , could any one help me to resolve this problem
>
> Thanks in advance
> Sajin
>



 
Reply With Quote
 
Geoff Munday
Guest
Posts: n/a
 
      6th Jun 2006
Derive a custom control from a Panel and add the following code to
"paint" the red border.

protected override void OnPaint(PaintEventArgs pe)
{
// TODO: Add custom paint code here
pe.Graphics.DrawRectangle(Pens.Red,
pe.ClipRectangle.Left,
pe.ClipRectangle.Top,
pe.ClipRectangle.Width - 1,
pe.ClipRectangle.Height - 1);

// Calling the base class OnPaint
base.OnPaint(pe);
}

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I want to change control panel action jinxy Windows XP Configuration 2 3rd Oct 2009 09:00 PM
Change DetailsView BorderColor rn5a@rediffmail.com Microsoft ASP .NET 3 16th Apr 2007 09:16 AM
How to change icons in Control Panel =?Utf-8?B?dHlzb2g=?= Windows Vista General Discussion 17 15th Apr 2007 06:55 AM
Create a TextBox control with BorderColor property sreenish Microsoft Dot NET 1 29th Jul 2005 09:40 AM
Panel Bordercolor =?Utf-8?B?SmVmZiBT?= Microsoft VB .NET 2 9th Jun 2004 06:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:14 AM.