guest31ro Posted May 19, 2003 Posted May 19, 2003 Win Form I have a win form, without the title bar, and I want to move the form.:( Can someone help me?:( If it's posible please give me the code... Thanks. :) Quote
*Gurus* divil Posted May 20, 2003 *Gurus* Posted May 20, 2003 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); } Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Madz Posted May 20, 2003 Posted May 20, 2003 just on the windows taskbar right click on the application and choose move and then you can move this form Quote The one and only Dr. Madz eee-m@il
guest31ro Posted May 21, 2003 Author Posted May 21, 2003 Thanks a lot divil, it's working great. :) Quote
guest31ro Posted May 21, 2003 Author Posted May 21, 2003 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. Quote
*Gurus* divil Posted May 22, 2003 *Gurus* Posted May 22, 2003 I'm afraid DX9 video is beyond the scope of my knowledge, but if you can catch the form's LocationChanged event and force a refresh of the video location somehow that ought to do the trick. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.