开发者

Get mousemove over Combobox popup list

When my mouse moves to the bottom of Combobox popup list, the list automaticly start to scroll down. But when I'm the bottom and goes to the top, there is no autoscrolling effect so I want to disable this behaviour, couse it only work in one way, down..

I cannot find any property, so I try to get mousemove event on that dropdown-list to cancel it, or make it handled, but it is triggered only on combobox itself, not on the list.

I also try to create something on top of that list, such as invisible panel which gets mouse move events instead of that dropdown-list, but I cannot fin开发者_Python百科d anything useful, couse that list is always at the top of everything.

Another idea was to find an event which is executed when items which are shown in popup list are changed and stop it when the mouse didn't grab the scrollbar, or click it, but this is also immposible. No events triggered. there is only selectedchanged event, but this is trigger on select not on the scrool.

Is there any solution to do this?


Finally I found the answer!!!

I had about 26 lines in my Combobox List, that was liitle to big so I wanted to show only 7 of them per time.

I found DropDownHeight property, and set it: Property ItemHeight was set to 13, couse the Font.Size was 8,25 (default). 7*13 = 91. And set it.

Get mousemove over Combobox popup list

.

And it works almost perfectly, but there was a problem with autoscrooling. (which I asked above)

Finally I realised that last line (here is NNN) is not fully shown. And when mouse Enters this line, the ComboBox Control want to show me whole line and scrolls it UP.

I started to change size and find out, that the line is being shown totally when it is set to 93 (= 7*13 + 2). Why 2? Probably because a bottom and top border. And now there is no autoscrolling...

Get mousemove over Combobox popup list

I also find, that another possibility is to set:

ComboBox1.IntegralHeight = False;
ComboBox1.MaxDropDownItems = 7;

And this works only when there was no changes in DropDownHeight, default value in my case was 106 ( = 8*13 + 2) couse the default value of MaxDropDownItems is 8.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜