![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Draw a LINE on a TABCONTROL??? Can someone spell out for me how in VB.NET I would draw a line across a TablControl Page? Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Draw a LINE on a TABCONTROL??? > Can someone spell out for me how in VB.NET I would draw a line across Quote: > a TablControl Page? > > Thanks in advance. (1) Mainly requires to draw the whole control public partial class TabControlWithLine : TabControl { public TabControlWithLine() { InitializeComponent(); SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.DoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint, true); } protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Graphics graphics = e.Graphics; graphics.Clear(Color.White); Pen pen = new Pen(Color.Black, 2); graphics.DrawLine(pen, new Point(Width, 0), new Point(0, Height)); } } (2) Propably will be not enough for you private void tabControl1_DrawItem(object sender, System.Windows.Forms.DrawItemEventArgs e) { SolidBrush FillBrush = new SolidBrush(Color.Red); Rectangle ItemRect = tabControl1.GetTabRect(e.Index); Graphics graphics = e.Graphics; graphics.FillRectangle(FillBrush, ItemRect); Pen pen = new Pen(Color.Black, 2); graphics.DrawLine(pen, new Point(ItemRect.Left, ItemRect.Bottom), new Point(ItemRect.Right, ItemRect.Top)); } As far as I know this control is painted by windows so there is not much we can do about the painting. Finally the website: http://dotnetrix.co.uk/tabcontrol.htm Dawid Rutyna |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Draw a LINE on a TABCONTROL??? On 12/03/2009 in message <gpbijo$es7$1@xxxxxx> Dawid Rutyna wrote: Quote: >It was hard for me to draw this line, this is the solution: You can sometimes get away with putting a label on a control and reducing its height to 1 or 2 pixels. Makes a reasonable low resource line. -- Jeff Gaines Damerham Hampshire UK |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Custom Control between tabcontrol and Outlook bar | .NET General | |||