   [SlimDX] Glitch rendering to WinForms Panel with other controls
  Hi,Just wondering if anyone can give me a clue about this issue - hopefully it's a quick and obvious answer.I have a WinForms application in which I'm rendering a scene to a panel covering some of the main form, and other standard controls (some buttons, a PropertyGrid etc) on the rest of the form.  Think "level editor" and you'll get the picture, though it's not quite that.The PropertyGrid has a drop-down colour-chooser as one of its entries.  The first time I use this drop-down box causes the output panel to not be drawn i.e. SlimDX doesn't render anything - I've set the background colour of the panel to hot pink to prove it's not just a 'no objects in view' kind of problem.  If the SlimDX rendering was occurring at all I'd expect it to at least clear to white and present.  As soon as the drop down closes drawing resumes as normal, and after that I can use the dropdown box as much as I like without any problems.I've checked the SlimDX device isn't lost at any time during the process.It's difficult to know what code to post in this case as it seems more like a designer problem, like maybe I'm just missing some flags to do with paint events or something.  Anyone else come across anything similar?L-   
Typically you only need to worry about the paint flags to make sure the control isn't painting its background in GDI and then painting your content using SlimDX. This can cause problems, although its sympthom is flickering rather than stuff not drawing. In any case, you can solve this by overriding OnPaintBackground with an empty method (so no call to base, just doing nothing) or by calling Setstyle(Controlstyles.AllPaintingInWmPaint, true) from the subclass constructor.As for the actual problem, I can only offer some guesses. I recall I had some problems rendering to a Panel back in the MDX days, escpecially when the Panel doesn't have any child Controls. I don't remember the specifics, but I think inheriting from a Control rather than a Panel to render to solved some issues for me. Other than that your render loop might be something to look into. If you're using a Paint/Invalidate style loop, the 'top-level colour window' might be grabbing focus and preventing the Invalidate from being processed.In any case it might be a good idea to print some debug message from your paint method (containing your present call) to see if it's actually being called when the colour dialog is open. If not, it's probably a focus/window message/render loop related issue. If it is being called, I'm out of guesses [smile];  Thanks for the reply.  Deriving a basic output from Control instead of using a Panel sounds like a reasonable test, in case the Panel is doing something unusual outside my, er, control.  It's just unusual that it only happens the first time the colour chooser drop-box is opened.  After that no matter what I do in the UI the SlimDX rendering carries on without a flicker or hitch.Will post again if I find a solution.L-   