By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,950 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,950 IT Pros & Developers. It's quick & easy.

Windows Application: Drawing control over boundaries?

P: n/a
Ty
Hi all

following scenario: i have a usercontrol with a search-textbox who
opens a datagrid to show filtered records. unfortunatly this datagrid
is limited to the boundaries of the usercontrol wich limits the height
to some 4 records. (i know i could use a normal dropdowncontrol, but
this is not good enough for some reasons).
right now i've solved it by opening a new borderless form wich is
aligned to the search-textbox. needless to say, this approach is
difficult to handle because this dumy-form is somewhat disconnected to
the searchtextbox.

in general, is it possible to draw a control or usercontrol somewhere
outside it's containers boundaries, somewhere on the screen?

Thank You!
Nov 19 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Wed, 19 Nov 2008 00:50:17 -0800, Ty <ty********@gmail.comwrote:
Hi all

following scenario: i have a usercontrol with a search-textbox who
opens a datagrid to show filtered records. unfortunatly this datagrid
is limited to the boundaries of the usercontrol wich limits the height
to some 4 records. (i know i could use a normal dropdowncontrol, but
this is not good enough for some reasons).
right now i've solved it by opening a new borderless form wich is
aligned to the search-textbox. needless to say, this approach is
difficult to handle because this dumy-form is somewhat disconnected to
the searchtextbox.

in general, is it possible to draw a control or usercontrol somewhere
outside it's containers boundaries, somewhere on the screen?
Define "draw". You certainly can place the control in that way. And you
can draw the control in the sense that the display code responsible for
rendering the control can execute normally.

But if you mean "can the control actually be _visible_ outside the parent
container", the answer is generally no. The child control is clipped to
the parent.

One option would be to set the AutoScroll property of the UserControl to
"true", so that at least the user could scroll to see all of the DataGrid.

Another alternative would be to not display the DataGrid inside the
UserControl itself. You could either do it the way you're doing it now,
or just abandon the idea of having the DataGrid physically connected to
the TextBox and show it as a modeless dialog or something like that.

Pete
Nov 19 '08 #2

P: n/a
Ty
On 19 Nov., 11:33, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Wed, 19 Nov 2008 00:50:17 -0800, Ty <tylersh...@gmail.comwrote:
Hi all
following scenario: i have a usercontrol with a search-textbox who
opens a datagrid to show filtered records. unfortunatly this datagrid
is limited to the boundaries of the usercontrol wich limits the height
to some 4 records. (i know i could use a normal dropdowncontrol, but
this is not good enough for some reasons).
right now i've solved it by opening a new borderless form wich is
aligned to the search-textbox. needless to say, this approach is
difficult to handle because this dumy-form is somewhat disconnected to
the searchtextbox.
in general, is it possible to draw a control or usercontrol somewhere
outside it's containers boundaries, somewhere on the screen?

Define "draw". *You certainly can place the control in that way. *Andyou *
can draw the control in the sense that the display code responsible for *
rendering the control can execute normally.

But if you mean "can the control actually be _visible_ outside the parent*
container", the answer is generally no. *The child control is clipped to *
the parent.

One option would be to set the AutoScroll property of the UserControl to *
"true", so that at least the user could scroll to see all of the DataGrid..

Another alternative would be to not display the DataGrid inside the *
UserControl itself. *You could either do it the way you're doing it now, *
or just abandon the idea of having the DataGrid physically connected to *
the TextBox and show it as a modeless dialog or something like that.

Pete

Thanks Pete

i wanted to know if there are better options out there, so "no" as an
answer is also good ;). right now im showing it as borderless form.
but there's a lot of event handling that has to go on (if form
resizes, moves, application loses focus etc etc).
the other thing i could do is showing the grid on the parent form of
the usercontrol, easier to handle. disadvantage is that i'm limited to
the form borders, whereas a combobox can show it's list over the
formborders. from a user standpoint it would really be better to have
it as big as neccessary, and i hate to make compromises for technical
reasons...

oh well :)

solutions still welcome

thanks and have a nice day
Nov 20 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.