Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: Add int to DateTime in C# Pin
PIEBALDconsult31-Mar-10 9:41
mvePIEBALDconsult31-Mar-10 9:41 
GeneralRe: Add int to DateTime in C# Pin
Luc Pattyn31-Mar-10 9:46
sitebuilderLuc Pattyn31-Mar-10 9:46 
GeneralRe: Add int to DateTime in C# Pin
PIEBALDconsult31-Mar-10 9:47
mvePIEBALDconsult31-Mar-10 9:47 
GeneralRe: Add int to DateTime in C# Pin
Luc Pattyn31-Mar-10 9:55
sitebuilderLuc Pattyn31-Mar-10 9:55 
GeneralRe: Add int to DateTime in C# Pin
PIEBALDconsult31-Mar-10 9:58
mvePIEBALDconsult31-Mar-10 9:58 
QuestionExport Rational Rose (UML) to SQL Diagram [modified] Pin
jojoba201131-Mar-10 5:11
jojoba201131-Mar-10 5:11 
Answer[Wrong Forum] Pin
Keith Barrow31-Mar-10 5:20
professionalKeith Barrow31-Mar-10 5:20 
QuestionTabcontrol flicker Pin
Wannes Geysen31-Mar-10 4:24
Wannes Geysen31-Mar-10 4:24 
Hi,

I've got a form with a gradient background. On that form I places a tabcontrol. But when I a hover a tab of the tabcontrol, the tab starts flickering a lot. Is there any way to stop this flicker?

I have already found some solutions. One of them is to create a custom control which inherits from System.Windows.Forms.Tabcontrol.
I dit this and the flicker is gone, but when I use the following code, the font on my tabs isn't the default font like the rest of my form.

public class DoubleBufferedTabControl : TabControl
{
	private System.Drawing.Bitmap buffer;
	public DoubleBufferedTabControl()
	{
		this.SetStyle(ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.AllPaintingInWmPaint, true);
	}
	protected override void OnPaint(PaintEventArgs e)
	{
		//Todo : lettertype overnemen van form
		this.SetStyle(ControlStyles.UserPaint, false);
		base.OnPaint(e);
		System.Drawing.Rectangle o = e.ClipRectangle;
		System.Drawing.Graphics.FromImage(buffer).Clear(System.Drawing.SystemColors.Control);
		if (o.Width > 0 && o.Height > 0)
			DrawToBitmap(buffer, new System.Drawing.Rectangle(0, 0, Width, o.Height));
		e.Graphics.DrawImageUnscaled(buffer, 0, 0);
		this.SetStyle(ControlStyles.UserPaint, true);
	}

	protected override void OnResize(EventArgs e)
	{
		base.OnResize(e);
		buffer = new System.Drawing.Bitmap(Width, Height);
	}
}


So if there is no easy way to stop this flicker, how can i get the font on my tabs just like the font of the rest of my form?
AnswerRe: Tabcontrol flicker Pin
Luc Pattyn31-Mar-10 4:39
sitebuilderLuc Pattyn31-Mar-10 4:39 
GeneralRe: Tabcontrol flicker Pin
Wannes Geysen31-Mar-10 4:57
Wannes Geysen31-Mar-10 4:57 
GeneralRe: Tabcontrol flicker Pin
Luc Pattyn31-Mar-10 5:54
sitebuilderLuc Pattyn31-Mar-10 5:54 
AnswerRe: Tabcontrol flicker Pin
Som Shekhar31-Mar-10 5:12
Som Shekhar31-Mar-10 5:12 
GeneralRe: Tabcontrol flicker Pin
Wannes Geysen31-Mar-10 5:18
Wannes Geysen31-Mar-10 5:18 
QuestionPrintDocument clipping / wrapping text problem Pin
Mark F.31-Mar-10 3:07
Mark F.31-Mar-10 3:07 
AnswerRe: PrintDocument clipping / wrapping text problem Pin
Luc Pattyn31-Mar-10 4:46
sitebuilderLuc Pattyn31-Mar-10 4:46 
General[Solved] Re: PrintDocument clipping / wrapping text problem Pin
Mark F.31-Mar-10 5:20
Mark F.31-Mar-10 5:20 
GeneralRe: [Solved] Re: PrintDocument clipping / wrapping text problem Pin
Luc Pattyn31-Mar-10 6:01
sitebuilderLuc Pattyn31-Mar-10 6:01 
QuestionPassing TextWriter through a function Pin
Steve-Co31-Mar-10 2:36
Steve-Co31-Mar-10 2:36 
AnswerRe: Passing TextWriter through a function Pin
Keith Barrow31-Mar-10 2:43
professionalKeith Barrow31-Mar-10 2:43 
GeneralRe: Passing TextWriter through a function Pin
Steve-Co31-Mar-10 2:47
Steve-Co31-Mar-10 2:47 
GeneralRe: Passing TextWriter through a function Pin
Keith Barrow31-Mar-10 2:58
professionalKeith Barrow31-Mar-10 2:58 
GeneralRe: Passing TextWriter through a function Pin
Mirko198031-Mar-10 3:00
Mirko198031-Mar-10 3:00 
AnswerRe: Passing TextWriter through a function Pin
R. Giskard Reventlov31-Mar-10 2:45
R. Giskard Reventlov31-Mar-10 2:45 
GeneralRe: Passing TextWriter through a function Pin
Luc Pattyn31-Mar-10 2:54
sitebuilderLuc Pattyn31-Mar-10 2:54 
GeneralRe: Passing TextWriter through a function Pin
R. Giskard Reventlov31-Mar-10 2:59
R. Giskard Reventlov31-Mar-10 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.