简体   繁体   English

自定义绘图选择矩形

[英]Custom draw selection rectangle

I am working on a custom control based on a ListView control. 我正在基于ListView控件的自定义控件上工作。 The goal of the control is to show the events name in the first column and the event duration on a timeline on the second column. 控件的目标是在第一列中显示事件名称,在第二列中的时间轴上显示事件持续时间。 I've implemented the custom drawing for the timeline section and it all works. 我已经为时间轴部分实现了自定义绘图,并且一切正常。

Now I would like to implement a "zooming" feature. 现在,我想实现“缩放”功能。 Where the user would be able to click somewhere on the second column drag the mouse and upon release the timeline would be zoomed in with starting and end times matching the mousedown/mouseup events. 用户可以在第二列的某处单击的地方拖动鼠标,放开鼠标后,时间线将被放大,开始和结束时间与mousedown / mouseup事件匹配。

Currently when I click/drag the mouse, a normal selection box appears. 当前,当我单击/拖动鼠标时,会出现一个普通的选择框。 I would like to overide that such that I get don't get a box but more of a vertical area (so the selection is only based on the timeline axis). 我想对此进行覆盖,以至于我没有得到一个框,而是有更多的垂直区域(因此,选择仅基于时间轴)。

I really don't know where to look and how to overide the drawing the selection box. 我真的不知道在哪里看以及如何覆盖选择框。 Any pointers/sample code would be appreciated. 任何指针/示例代码将不胜感激。

好吧,如果您不需要多选选项,请将MultiSelect属性设置为false禁用橡皮筋选择。

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

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