User control like Dropdown.

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.
 
D

David Gouge

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
 
S

Sin Jeong-hun

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top