vb.net controls:
I'm trying to make an interface where the main form is an ellipse shape.
When the user clicks a particular area, another non-rectangular "panel"
slides out from behind the main ellipse (similar to how some of WinAmp's
skinned modes do for control panels). I'm using a Form as a "canvas" for
these two controls. The form's BackGroundColor and TransparencyKey are both
set to the same color and the form is borderless/titlebarless. I have two
UserControls (MainUI and ControlPanel) that are using Bob Powell's technique
for transparent controls (Setting WS_EX_TRANSPARENT (hex 20) in
CreateParams, Overriding OnPaintBackground and doing nothing, invalidating
the parent's rectangle in OnResize and OnMove, and using DrawImage to paint
a .png image in OnPaint).
The MainUI control is 640x480 and the Form is 840x480 (200 wider than
MainUI). The idea is that I put MainUI against the left side of the form,
and put ControlPanel behind it so it can't be seen. When the user clicks a
particular place on MainUI, I slide the ControlPanel control to the right on
the (invisible) form until it's right side is against the right side of the
form (sticking out from under MainUI by 200 pixels). That's the "theory".
Now for the reality.
The first problem I'm having is that as I'm sliding ControlPanel to the
right, it's flickering REAL bad. In the region where ControlPanel is (even
though it's "behind" MainUI) I see the MainUI control, the whole
ControlPanel control, and the region behind the Form itself (the desktop, or
other windows). It draws all three rapidly every time I move ControlPanel.
When I stop moving ControlPanel, everything is drawn properly. MainUI is
drawn on top of the portion of ControlPanel that is still "behind" it and
all is good, so I'm assuming that MainUI is being drawn last.
The second problem I'm having is that in order to get MainUI drawn last so
that when I'm done moving ControlPanel (and it's done flickering enough to
cause seizures) MainUI is drawn on top of ControlPanel, I have to put the
MainUI control behind the ControlPanel control on the form. Now this seems
VERY backwards to me. It is seemingly drawing the controls from the front
to the back instead of from the back to front. If I put MainUI in front of
ControlPanel in design mode, then it appears behind ControlPanel at runtime.
And visa-versa. When I put MainUI behind ControlPanel in design mode then
it appears in front of ControlPanel at runtime.
If anyone can help or point me in the right direction for help, I'd greatly
appreciate it. Bob Powell, if you run across this message... HELP! :) You
seem to be the god (demi-god?) of GDI+ work... :)
-----
Lee