Move form should move video as well
Hi,
My application is a simple mediaplayer, capable of playing two video files (shown in two UserControls on a Mdi child form in aTableLayoutPanel, Dock.Fill) at the same time. When I move the Mdi parent or child form (with its two UserControls) the video output does not move as wanted (part of the video is cut off).
What I've done:
If the Move event is fired (mdi child form), then the following method in the UserControl is called:
void ChildForm_Move(object sender, System.EventArgs e) { Rectangle rect; // videoWindow1 is a UserControl rect = videoWindow1.RectangleToScreen(videoWindow1.ClientRectangle); } publicvoid MoveVideoWindow(int left,int top,int width,int height) { int hr = 0; // Track movement and resize - UserControl method if (this.videoWindow != null) { // videoWindow is of type IVideoWindow hr = this.videoWindow.SetWindowPosition( left, top, width, height ); DsError.ThrowExceptionForHR(hr); } } |
How can I make the video move correctly? I am using DirectShowNet.
Thank you!

