获取上具有ComboBox鼠标事件 [英] Getting Mouse Events on a ComboBox
问题描述
我的工作WINCE平台,开发Windows在C#形式的应用程序,我需要实现一个鼠标单击事件的下拉框,但Compact Framework不具有鼠标点击事件支持
任何人都可以建议我实施组合框的鼠标单击事件(下拉框)的另一种方式。
PS:我使用下拉框GOT焦点事件,但它不灵活,我需要运行该代码的下拉框,单击或当它向下跌落时
任何建议或代码片段将帮助我很多。谢谢 !!
我会高兴,如果这可以帮助ü,否则请不要否决:D;)
$ B 私人无效Form1_MouseDown(对象发件人,MouseEventArgs:
$ b 美国可以在表单上使用这个事件E)
{
INT MAXX = 1000;
INT其minX = 5;
INT MAXY = 1000;
INT MINY = 5;
如果((MousePosition.X< MAXX)及及(MousePosition.X>其minX)
和;及(MousePosition.Y> MINY)及和放大器; (MousePosition.Y< MAXY))
{
//做些什么
}
}
就像你看到的我有限的鼠标的位置。这必须工作;)
I am working on WINCE platform, developing windows form app in C#, I need to implement a mouse click event for DROP DOWN BOX, but compact framework doesn't have a support for mouse click events.
Can anyone suggest me any alternative way to implement the MOUSE CLICK EVENT for combobox (DROP DOWN BOX).?
PS: I am using GOT FOCUS EVENT on drop down box but it's not flexible, I need to run the code when the DROP DOWN BOX is clicked or when it is DROPPED DOWN.
Any suggestions or code snippets will Help me a lot. Thanks !!
I will happy if this could help u,otherwise please do not vote down :D ;)
u can use this event on your form:
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
int maxX = 1000;
int minX = 5;
int maxY = 1000;
int minY = 5;
if ((MousePosition.X < maxX) && (MousePosition.X > minX)
&& (MousePosition.Y > minY) && (MousePosition.Y < maxY))
{
//do something
}
}
As u can see I have limited the position of mouse. this must work ;)
这篇关于获取上具有ComboBox鼠标事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!