Windows 表格。在面板边框上绘制控件

Windows forms. Draw a control over panel border

我已经搜索了很长时间,但似乎找不到我需要的东西。我有一个自定义按钮(单击按钮以在按钮下方显示树视图),一切正常,但是如果我将按钮放在面板中(面板是自定义按钮的父级,按钮是treeview) 然后我点击按钮,面板边框切断了 treeview 控件。

我知道我可以更改控件的父级,它会解决问题。但是,我希望控件像普通组合框一样工作,下拉菜单将在面板的边框上呈现(绘制、显示)。

这就是我需要发生的事情

这就是我的树视图发生的情况

I understand I can change the parent of the control and it will fix the problem. However

实际上它也不会修复它。表格还是会剪掉超出的区域。

I would like the control to act like a normal combobox

即使是正常的 ComboBox creates a new native window for the drop-down elements that is not parented into owner's parent control. This is somewhat similar to ToolTip and [context]menu windows. And also note that the drop-down window is not actually anchored to the owner control, meaning, it cannot be dragged with the 'parent' form: it is destroyed 一旦失去焦点,例如。当您单击表单的标题栏时。