Getting Mouse Events on a ComboBox

前端 未结 1 902
小鲜肉
小鲜肉 2021-01-20 17:20

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

1条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-20 17:45

    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 ;)

    0 讨论(0)
提交回复
热议问题