1

I am building a custom user control in c#, and the look of the control is an elipse, but the corners of the control can be seen with the default color.

I think that the best way to solve this is making the backcolor of the control transparent, but if i do it in properties doesn't work.

Daniel DiPaolo
  • 55,313
  • 14
  • 116
  • 115
Miguel
  • 907
  • 4
  • 26
  • 50
  • This makes little sense. If the control shape is an ellipse, how could you possibly see the corners? Use the Region property, just in case. – Hans Passant Feb 21 '11 at 18:57

1 Answers1

1

In the control's constructor, try adding a call to SetStyle(ControlStyles.SupportsTransparentBackColor)

Eric
  • 6,364
  • 1
  • 32
  • 49
  • Okay i have done some tests and it works, but i have another problem. If i put the control over some other control, the corners aren't transparent. So, how i solve this? – Miguel Feb 21 '11 at 19:11
  • That'ts because WinForms doesn't do "real" transparency. When a control has a transparent background, it really just draws its background in the background color of its parent control. – Eric Feb 21 '11 at 19:31
  • See this question: http://stackoverflow.com/questions/592538/how-to-create-a-transparent-control-which-works-when-on-top-of-other-controls – Eric Feb 22 '11 at 07:15