code_junkie

Controlling designer appearance of double-buffered owner-drawn UserControl in C#/.NET 2.0

Nov 12th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. protected override void OnPaintBackground(PaintEventArgs e)
  2. {
  3. // don't even have to do anything else
  4. }
  5.  
  6. if(this->DesignMode ||
  7. LicenseManager::UsageMode == LicenseUsageMode::Designtime)
  8. return;
  9.  
  10. if (this.DesignMode)
  11. {
  12. return; //or call base.OnPaintBackground()
  13. }
  14.  
  15. if (DesignMode || LicenseManager.UsageMode == LicenseUsageMode.Designtime)
  16. {
  17. return;
  18. }
Add Comment
Please, Sign In to add comment