This project is read-only.

Mouse events doesnt work on WPF

Oct 7, 2012 at 12:34 PM

Hi there! I am using sharpGL on a WPF project. I am trying to use the MouseDown event to trigger a method, but it doesnt react. Morover, none of the mouse events are working! Does anyone know what might be happening here?


Oct 7, 2012 at 1:58 PM

Well, I have already found a solution. I am calling the Window MouseDown event to trigger the same event on SharpGL control. It works like this:

        private void openGLControl_MouseDown(object sender, MouseButtonEventArgs e)
            Project.Modelo.Selection.SelectionMode = TSelectionMode.smNodePicking;
            Point MouseLoc = e.GetPosition(openGLControl); // Position relative to sharp GL control

            double w = openGLControl.Width;
            double h = openGLControl.Height;

            if (Made)
                Project.SelectElementWithOpenGL(MouseLoc.X, MouseLoc.Y, w, h);


It was not my intention to do it like that, but at least it work.