M
Marina
Hi,
It seems that I am seeing an inconsistency in the arguments that get passed
to the SplitterMoved vs. SplitterMoving events.
As in, the ones for the SplitterMoving are correct coordinates, and the ones
for SplitterMoving are not.
I have a panel with 2 controls in it and a splitter. I also have a textbox
to log all the values of the events.
I then have the following code to capture the event arguments:
Private Sub Splitter1_SplitterMoved(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved
Log("Moved", e.SplitX)
End Sub
Private Sub Splitter1_SplitterMoving(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoving
Log("Moving", e.SplitX)
End Sub
Private Sub Log(ByVal eventName As String, ByVal num As Integer)
results.Text += eventName + ": " & num & System.Environment.NewLine
End Sub
The results I get by running this program and moving the splitter a bit are:
Moving: 76
Moving: 77
Moving: 78
Moving: 79
Moving: 80
Moving: 81
Moving: 82
Moved: 123
Notice that the Moving is being fired correctly for every pixel.
However, when Moved has fired, it thinks that the splitter is at 123. When
clearly it would be at 82, since that is the last time Moving was called.
But in any case, it would not be 41 pixels over.
What is up with this? Am I looking at this the wrong way and doing something
incorrectly? Or is this a bug?
It seems that I am seeing an inconsistency in the arguments that get passed
to the SplitterMoved vs. SplitterMoving events.
As in, the ones for the SplitterMoving are correct coordinates, and the ones
for SplitterMoving are not.
I have a panel with 2 controls in it and a splitter. I also have a textbox
to log all the values of the events.
I then have the following code to capture the event arguments:
Private Sub Splitter1_SplitterMoved(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoved
Log("Moved", e.SplitX)
End Sub
Private Sub Splitter1_SplitterMoving(ByVal sender As Object, ByVal e As
System.Windows.Forms.SplitterEventArgs) Handles Splitter1.SplitterMoving
Log("Moving", e.SplitX)
End Sub
Private Sub Log(ByVal eventName As String, ByVal num As Integer)
results.Text += eventName + ": " & num & System.Environment.NewLine
End Sub
The results I get by running this program and moving the splitter a bit are:
Moving: 76
Moving: 77
Moving: 78
Moving: 79
Moving: 80
Moving: 81
Moving: 82
Moved: 123
Notice that the Moving is being fired correctly for every pixel.
However, when Moved has fired, it thinks that the splitter is at 123. When
clearly it would be at 82, since that is the last time Moving was called.
But in any case, it would not be 41 pixels over.
What is up with this? Am I looking at this the wrong way and doing something
incorrectly? Or is this a bug?