User control like Dropdown.

  • Thread starter Thread starter Sin Jeong-hun
  • Start date Start date
S

Sin Jeong-hun

If I create a button like control, then I simply can draw button-like
lines on my User Control's surface by getting its Graphics g. If I draw
outside of the control's ClientRectangle (for example, -10,-10,-5,-5),
it is simply cut out.

But what about if I'm trying to make a dropdown list control in .NET?
The dropped down part is outside of the control's ClientRectangle. How
can I do such thing? Maybe create a borderless window and display it?
But that seems to be very slow ( because creating a .NET Form is very
slow) and there's another problem of z-order.

Please advise me. Thank you.
 
Sin said:
If I create a button like control, then I simply can draw button-like
lines on my User Control's surface by getting its Graphics g. If I draw
outside of the control's ClientRectangle (for example, -10,-10,-5,-5),
it is simply cut out.

But what about if I'm trying to make a dropdown list control in .NET?
The dropped down part is outside of the control's ClientRectangle. How
can I do such thing? Maybe create a borderless window and display it?
But that seems to be very slow ( because creating a .NET Form is very
slow) and there's another problem of z-order.

Please advise me. Thank you.

Not a big authority on User Controls, but can you not just extend the
ClientRectangle to the size you require?

Not infront of VS at the moment so can't check.

HTH

Dave
 
Well, what if it should draw outside of even the form? As you see, real
dropdown list expands to the outside of the form which it is on.
Expanding the control's size will be OK if there is no other controls
on the form and the form is empty. But what about another control is
near and that control is added later than my control? Expanding my
control will make it draw itself under the control, I think.
 
Back
Top