简体   繁体   English

C#突出显示控件上方的表单部分

[英]C# highlight part of form over controls

I am creating graphs (panels) and I want to highlight some line(area) of these panels by using MouseEnter/MouseLeave. 我正在创建图形(面板),并且想通过使用MouseEnter / MouseLeave突出显示这些面板的某些线(面)。
To be more specific, there are also another controls on form (Buttons, DGV, etc) and I have main scrollable panel for graph area. 更具体地说,窗体上还有另一个控件(按钮,DGV等),我有一个用于图形区域的主可滚动面板。 In this panel, there are panels as columns (dates) and in these columns are panels with some backcolors as lines. 在此面板中,有一些面板作为列(日期),在这些列中是一些带有底色的面板。 These lines should be highlighted on MouseEnter. 这些行应在MouseEnter上突出显示。
I also need to be able to click on these panels after highlighting line to run events which are on panels. 我还需要能够在高亮显示行之后单击这些面板以运行面板上的事件。
I am creating all controls programatically and have DB data source. 我正在以编程方式创建所有控件,并具有DB数据源。 Quite close but dirty code is crete new form with size for example (2000, 20) without borders, set opacity and backcolor. 相当接近但肮脏的代码是crete新格式,其大小例如(2000,20),没有边界,设置了不透明度和背景色。
Thanks in advance for any suggestion 预先感谢您的任何建议

Maybe you should consider doing all this (creating graphs, etc.) via Graphics instead of Controls! 也许您应该考虑通过图形而不是控件来完成所有这些操作(创建图形等)! In that case you would have full control over event handling, highlighting, and so on. 在这种情况下,您将完全控制事件处理,突出显示等。

I do not think there is a clean way to achieve what you want by using controls only. 我认为没有一种干净的方法可以仅通过使用控件来实现所需的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM