Click here to Skip to main content
15,925,181 members
Home / Discussions / C#
   

C#

 
GeneralDictionary Class Pin
MStanbrook15-Jan-03 14:11
MStanbrook15-Jan-03 14:11 
GeneralRe: Dictionary Class Pin
leppie15-Jan-03 14:37
leppie15-Jan-03 14:37 
GeneralRe: Dictionary Class Pin
Philip Fitzsimons16-Jan-03 1:42
Philip Fitzsimons16-Jan-03 1:42 
GeneralAccessing/remoting a network PC Pin
vlusardi15-Jan-03 13:37
vlusardi15-Jan-03 13:37 
QuestionCloning a control? Pin
FruitBatInShades15-Jan-03 13:17
FruitBatInShades15-Jan-03 13:17 
AnswerRe: Cloning a control? Pin
leppie15-Jan-03 13:46
leppie15-Jan-03 13:46 
GeneralSubclassing Problems.... Pin
FruitBatInShades15-Jan-03 12:01
FruitBatInShades15-Jan-03 12:01 
GeneralRe: Subclassing Problems.... Pin
leppie15-Jan-03 13:49
leppie15-Jan-03 13:49 
From the MagicLibrary's readme (tips section):

You have just spent several days writing a beautiful looking custom control but are faced with one last problem that is spoiling the whole effect. Whenever the control is redrawn it flickers. This is most obvious when the control is being resized and so redrawn many times in succession.
Solving this problem is very easy with the .NET Framework. If you come from a C++ and GDI background then the solution was to create a memory based bitmap, draw the control onto the bitmap and then blit this to the screen (otherwise known as double buffering). This is such a common requirement that the UserControl class actually implements this functionality for you. All you need to do is include the following two lines of code into your class constructor.
SetStyle(ControlStyles.DoubleBuffer, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);

The first line will request that double buffering be used whenever the OnBackground or OnPaint methods are called. This will reduce the amount of flicker but may not remove it completely as painting the whole control still results in two separate blitting operations.
The second line of code above is used to ensure that only a single blitting operation occurs when drawing. This occurs when the underlying windows WM_PAINT message is processed. When this happens it will create the memory bitmap, call the OnBackground method, call the OnPaint method and then finally blit the result to the screen.

The only drawback to this technique is the greater use of resources. However, most controls are relatively small in screen size and so this is unlikely to be an issue.


WebBoxes - Yet another collapsable control, but it relies on a "graphics server" for dynamic pretty rounded corners, cool arrows and unlimited font support.

GeneralRe: Subclassing Problems.... Pin
FruitBatInShades15-Jan-03 23:07
FruitBatInShades15-Jan-03 23:07 
GeneralRe: Subclassing Problems.... Pin
James T. Johnson15-Jan-03 15:07
James T. Johnson15-Jan-03 15:07 
GeneralRe: Subclassing Problems.... Pin
FruitBatInShades16-Jan-03 0:56
FruitBatInShades16-Jan-03 0:56 
GeneralRe: Subclassing Problems.... Pin
FruitBatInShades16-Jan-03 0:53
FruitBatInShades16-Jan-03 0:53 
GeneralDelegate parameter info Pin
leppie15-Jan-03 6:37
leppie15-Jan-03 6:37 
GeneralRe: Delegate parameter info Pin
Richard Deeming15-Jan-03 7:16
mveRichard Deeming15-Jan-03 7:16 
GeneralRe: Delegate parameter info Pin
leppie15-Jan-03 8:15
leppie15-Jan-03 8:15 
GeneralPlease help me(All about loading control in class file) Pin
Gurus Guru15-Jan-03 2:09
Gurus Guru15-Jan-03 2:09 
GeneralRe: Please help me(All about loading control in class file) Pin
James T. Johnson15-Jan-03 15:13
James T. Johnson15-Jan-03 15:13 
GeneralRe: Please help me(All about loading control in class file) Pin
Anonymous15-Jan-03 20:50
Anonymous15-Jan-03 20:50 
GeneralRe: Please help me(All about loading control in class file) Pin
Vasudevan Deepak Kumar15-Jan-03 23:08
Vasudevan Deepak Kumar15-Jan-03 23:08 
GeneralRe: Please help me(All about loading control in class file) Pin
Gurus Guru17-Jan-03 6:02
Gurus Guru17-Jan-03 6:02 
Generalknow the apps a user/machine ran Pin
Giovanni Bejarasco15-Jan-03 1:30
Giovanni Bejarasco15-Jan-03 1:30 
GeneralRe: know the apps a user/machine ran Pin
Mazdak15-Jan-03 6:06
Mazdak15-Jan-03 6:06 
GeneralCalling .NET object from COM Pin
SimonS14-Jan-03 22:10
SimonS14-Jan-03 22:10 
GeneralRe: Calling .NET object from COM Pin
Daniel Turini14-Jan-03 22:17
Daniel Turini14-Jan-03 22:17 
GeneralRe: Calling .NET object from COM Pin
Nick Parker15-Jan-03 8:44
protectorNick Parker15-Jan-03 8:44 

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.