ControlPaint is great for vanilla effects. If you want something a bit more
specific then roll-your-own graphics is great.
The idea is to show a highlight to the upper-left and a shadow to the
lower-right. These effects can be more or less complex.
For example..
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawRectangle(Pens.White,new Rectangle(10,10,300,200));
e.Graphics.DrawRectangle(Pens.DarkGray, new Rectangle(11,11,300,200));
}
--
Bob Powell [MVP]
Visual C#, System.Drawing
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
[quoted text, click to view] "Craig" <Craig@discussions.microsoft.com> wrote in message
news:DC3CFEF2-F414-4356-B305-1FEED68345E5@microsoft.com...
> Hi Bob
> Thanks for the reply, I ended taking the 2 line approach; however I didn't
> know about ContralPaint. What would you suggest?
>
> Thanks again.
> Craig
>
> "Bob Powell [MVP]" wrote:
>
>> That's impossible to do with a 1 pixel line. The minimum is two pixels.
>>
>> You can do your own by drawing rectangles offset from one another by a
>> pixel
>> or use the ControlPaint class which has some border drawing routines.
>>
>> --
>> Bob Powell [MVP]
>> Visual C#, System.Drawing
>>
>> Find great Windows Forms articles in Windows Forms Tips and Tricks
>>
http://www.bobpowell.net/tipstricks.htm >>
>> Answer those GDI+ questions with the GDI+ FAQ
>>
http://www.bobpowell.net/faqmain.htm >>
>> All new articles provide code in C# and VB.NET.
>> Subscribe to the RSS feeds provided and never miss a new article.
>>
>>
>>
>>
>>
>> "Craig" <Craig@discussions.microsoft.com> wrote in message
>> news:C067140D-F4CE-46AA-A4F4-2113854E206D@microsoft.com...
>> > Hi
>> >
>> > I'm trying to draw a 1px horizontal line that has a sunken/bevel
>> > effect.
>> > Same style as the seperator lines displayed in a file property dialog
>> > (open
>> > Windows Explorer, right click a file, select Properties)
>> >
>> > Fairly new to WinForms, so any suggestions are appreciated.
>> >
>> > Craig
>>
>>
>>