walruz
walruz

Reputation: 1329

Contols intersect on windows form

I have two controls located on Windows Form. Problem is that these two controls have specific form and they intersect.

When I put first control before the second one it looks like this:

enter image description here

When I change order it looks like this:

enter image description here

How can I resolve such things properly?

Upvotes: 2

Views: 223

Answers (1)

Waescher
Waescher

Reputation: 5737

WinForms controls cannot do a true transparency. Their transparency is just to take the BackColor of their parents. If those controls are all custom painted (they look as if they are), you should draw the whole part in one control, if possible.

If not, consider to render the orange background in the control causing the black corner in the second picture as well. So in fact you'll have two different controls rendering parts of the orange area but it will look like it is just one.

If you look at the image, other controls have to render the parts above and left of the red lines. The controls attached to those sides have to draw the gray area and so I assume that there's a quite complex painting algorithm you have to adopt to draw the orange area as well.

Upvotes: 1

Related Questions