Click here to Skip to main content
15,916,463 members
Home / Discussions / C#
   

C#

 
QuestionHelp with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 2:55
Martiankeeper3-Feb-06 2:55 
AnswerRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 3:36
mmikey73-Feb-06 3:36 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 3:53
Martiankeeper3-Feb-06 3:53 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 4:11
mmikey73-Feb-06 4:11 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 4:02
Martiankeeper3-Feb-06 4:02 
GeneralRe: Help with Form Load - controls look black before drawing Pin
leppie3-Feb-06 4:14
leppie3-Feb-06 4:14 
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper3-Feb-06 4:24
Martiankeeper3-Feb-06 4:24 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 6:45
mmikey73-Feb-06 6:45 
Martiankeeper wrote:
1) Do I need to add any more code for DoubleBuffering to work? (do I need "this.UpdateStyles();" ???)


General answer is YES. See MSDN Doc[^]

Martiankeeper wrote:
2) Do I need to manually apply double buffering to the tabcontrols and listview controls?


You can't. It's protected property. You can apply double buffering only to your own controls(which of course have to inherit(directly or indirectly) from System.Windwos.Forms.Control class).


Martiankeeper wrote:
3) Do I need to apply double-buffering to MainForm, having already placed it in Base_Form?


NO. It's inherited. See the protected property Control.DoubleBuffered to see if your form is double buffered.


Martiankeeper wrote:
4) Am I correct in placing the double-buffering code in the constructor, or should it be in the "Load" event?


It's OK in constructor.


Martiankeeper wrote:
5) I create a User Control class called MyControl. I drop MyControl onto MainForm. Do I need to add the code "this.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true);" to the MyControl
class code, or do I set it from the MainForm class' code?


You need to add "this.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true);" line and "this.UpdateStyles();" line to constructor of your MyControl class. Once again, DoubleBuffered property is protected so you can't set it from other class.

There is a nice article[^] on how to creating your own control.

Hope this helps, I'm not native english speaker, my english is limited therefore I can't be more descriptive.

"Please! For the love of God! Can you help me unlearn VB?" -Jeremy Falcon
GeneralRe: Help with Form Load - controls look black before drawing Pin
Martiankeeper5-Feb-06 21:59
Martiankeeper5-Feb-06 21:59 
GeneralRe: Help with Form Load - controls look black before drawing Pin
mmikey73-Feb-06 7:31
mmikey73-Feb-06 7:31 
Questionquestion about split method c# Pin
fady_sayegh3-Feb-06 0:29
fady_sayegh3-Feb-06 0:29 
AnswerRe: question about split method c# Pin
Ingo3-Feb-06 2:08
Ingo3-Feb-06 2:08 
AnswerRe: question about split method c# Pin
Le centriste3-Feb-06 2:12
Le centriste3-Feb-06 2:12 
AnswerRe: question about split method c# Pin
mav.northwind3-Feb-06 2:30
mav.northwind3-Feb-06 2:30 
GeneralRe: question about split method c# Pin
leppie3-Feb-06 4:24
leppie3-Feb-06 4:24 
GeneralRe: question about split method c# Pin
mav.northwind3-Feb-06 4:44
mav.northwind3-Feb-06 4:44 
GeneralRe: question about split method c# Pin
leppie3-Feb-06 5:05
leppie3-Feb-06 5:05 
QuestionConverting pixels to inchs Pin
Farm Developer3-Feb-06 0:27
Farm Developer3-Feb-06 0:27 
AnswerRe: Converting pixels to inches Pin
Guffa3-Feb-06 0:37
Guffa3-Feb-06 0:37 
GeneralRe: Converting pixels to inches Pin
Ingo3-Feb-06 2:05
Ingo3-Feb-06 2:05 
QuestionC# programming-pratice Pin
sasire183-Feb-06 0:06
sasire183-Feb-06 0:06 
AnswerRe: C# programming-pratice Pin
Dave Kreskowiak3-Feb-06 1:46
mveDave Kreskowiak3-Feb-06 1:46 
AnswerRe: C# programming-pratice Pin
shabonaa3-Feb-06 3:52
shabonaa3-Feb-06 3:52 
AnswerRe: C# programming-pratice Pin
ekynox3-Feb-06 16:01
ekynox3-Feb-06 16:01 
QuestionISO 8601 Date/Time Format Pin
LiamD2-Feb-06 23:41
LiamD2-Feb-06 23:41 

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.