Click here to Skip to main content
15,922,407 members
Home / Discussions / C#
   

C#

 
GeneralRe: Can you use resources to embed a wav? Pin
jtmtv183-Mar-03 8:32
jtmtv183-Mar-03 8:32 
GeneralRe: Can you use resources to embed a wav? Pin
leppie4-Mar-03 6:57
leppie4-Mar-03 6:57 
GeneralAeru IRC is looking for developpers and artist Pin
Shock The Dark Mage2-Mar-03 12:46
Shock The Dark Mage2-Mar-03 12:46 
GeneralRe: Aeru IRC is looking for developpers and artist Pin
jtmtv183-Mar-03 19:17
jtmtv183-Mar-03 19:17 
GeneralRe: Aeru IRC is looking for developpers and artist Pin
Shock The Dark Mage5-Mar-03 15:47
Shock The Dark Mage5-Mar-03 15:47 
GeneralFlattening The TreeView... Pin
LokiSD2-Mar-03 10:26
LokiSD2-Mar-03 10:26 
GeneralRe: Flattening The TreeView... Pin
LokiSD3-Mar-03 7:42
LokiSD3-Mar-03 7:42 
GeneralRe: Flattening The TreeView... Pin
Furty4-Mar-03 1:49
Furty4-Mar-03 1:49 
In most cases you let WndProc handle the WM_NCPAINT method, then overpaint it yourself. A few of the controls will let you paint the border without having it painted by WndProc first, but many won't. I know this is double-painting, but with some controls there's just no way around it, save for rebuilding the entire control yourself. Also, after painting the border on some controls you will need to Send WM_ERASEBKGND and WM_PAINT after you've painted the border so that things like scrollbars are re-drawn.

Also, take care with the way you are creating your graphics object for painting. Some controls will work with a simple Graphics.FromHdc(Handle), but others will need to get their graphics instance from user32.dll like this:

[DllImport("user32.dll")]<br />
private static extern IntPtr GetWindowDC(IntPtr hWnd);<br />
Graphics g = Graphics.FromHdc(GetWindowDC(Handle));


One last note, make sure you don't set UserPaint, DoubleBuffer, AllPaintingInWmPaint for controls that you are going to paint borders on using the WM_NCPAINT WndProc override - doing so will only create you much frustration.

There are many controls in the base library that need to be WndProc painted, and all of them have their own little quirks. It took me a couple of days to learn the ins and outs of each, but once you've got the basic ideas it's fairly straight forward.
GeneralRe: Flattening The TreeView... Pin
LokiSD5-Mar-03 6:51
LokiSD5-Mar-03 6:51 
GeneralRe: Flattening The TreeView... Pin
Furty5-Mar-03 12:06
Furty5-Mar-03 12:06 
GeneralRe: Flattening The TreeView... Pin
Furty5-Mar-03 13:23
Furty5-Mar-03 13:23 
GeneralSnapshot Pin
Calamitous2-Mar-03 3:39
Calamitous2-Mar-03 3:39 
GeneralRe: Snapshot Pin
Jon Newman2-Mar-03 4:57
Jon Newman2-Mar-03 4:57 
GeneralProblem with Windows Installer Pin
Sassan Komeili Zadeh2-Mar-03 3:03
Sassan Komeili Zadeh2-Mar-03 3:03 
GeneralRe: Problem with Windows Installer Pin
Jon Newman2-Mar-03 4:27
Jon Newman2-Mar-03 4:27 
GeneralRe: Problem with Windows Installer Pin
Sassan Komeili Zadeh3-Mar-03 20:22
Sassan Komeili Zadeh3-Mar-03 20:22 
GeneralRe: Problem with Windows Installer Pin
Paul Riley2-Mar-03 5:15
Paul Riley2-Mar-03 5:15 
GeneralRe: Problem with Windows Installer Pin
Sassan Komeili Zadeh3-Mar-03 20:27
Sassan Komeili Zadeh3-Mar-03 20:27 
GeneralRe: Problem with Windows Installer Pin
Paul Riley4-Mar-03 3:44
Paul Riley4-Mar-03 3:44 
Generalexpose delegate in property grid Pin
Roger Alsing2-Mar-03 0:12
Roger Alsing2-Mar-03 0:12 
GeneralRe: expose delegate in property grid Pin
leppie2-Mar-03 1:49
leppie2-Mar-03 1:49 
GeneralRe: expose delegate in property grid Pin
Roger Alsing2-Mar-03 4:07
Roger Alsing2-Mar-03 4:07 
GeneralRe: expose delegate in property grid Pin
leppie2-Mar-03 11:37
leppie2-Mar-03 11:37 
GeneralRe: expose delegate in property grid Pin
leppie2-Mar-03 1:54
leppie2-Mar-03 1:54 
GeneralIPAddress range Pin
Mr BallyDaHob1-Mar-03 4:42
Mr BallyDaHob1-Mar-03 4:42 

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.