Jump to content
Xtreme .Net Talk

Recommended Posts

  • *Gurus*
Posted

Put this code at the top of your form:

 

using System.Runtime.InteropServices;

 

Then use the following code to make the form draggable by clicking on it anywhere:

 

[DllImportAttribute("user32.dll", CharSet=CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
[DllImportAttribute("user32.dll", ExactSpelling=true, CharSet=CharSet.Auto)]
public static extern int ReleaseCapture();
const int WM_NCLBUTTONDOWN = 0xA1;
const int HTCAPTION = 2;

private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}

MVP, Visual Developer - .NET

 

Now you see why evil will always triumph - because good is dumb.

 

My free .NET Windows Forms Controls and Articles

Posted

But now I have a new problem, I have a video object in that form, and when I move the form it changes to black, and only when is in the new place it starting to work fine.

I want to say that while I drag the form I don't see the content of the video.

I am using DirectX 9.0 SDK and the AudioVideoPayback namespace.

Can you help me with that?

Thanks.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...