开发者

Control that is bigger than the form region is getting clipped in C#

I have a normal Form control and in the CTOR function I have the following :

this.Region = System.Drawing.Region.FromHrgn(WinUser.CreateRoundRectRg开发者_开发百科n(0, 0, this.Width, this.Height, 16, 16));

Later in my App I create a ListBox object and show it at the bottom of my parent form, but the listbox size is bigger than my form and therefore the bottom half of the ListBox which is outside the Parent Form region gets clipped.

Is there any way around this, that is I do not want the form size to be increased instead I want the Listbox to show completely even if it is bigger than the form.

anand


This kind of feat can only be accomplished if you create a window that's allowed to extend past the boundaries of the form. Windows supports this, the dropdown list of a combo box would be an example. Windows Forms however doesn't care much for it. Check my code in this thread to see how it's done.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜