A
aagarwal8
hi,
Currently i am using the following code to move my borderless form,
where i have my own titlebar using a panel.
private const int WM_NCLBUTTONDOWN = 0xA1;
private const int HTCAPTION = 0x2;
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int
wParam, int lParam);
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
This code picks up the Windows setting of whether to show the window
contents while dragging or not.
However, i want to always hide the contents of my window while
dragging. Is there a way to achieve this?
Also, with this code when i try to hook the MouseUp event of my
panel1, i am not able to do so. After i perform a mouse click, the
control doesnt transfer to the event handler.
Solution to either of the problems will be of great help
Regards,
Ankit!
Currently i am using the following code to move my borderless form,
where i have my own titlebar using a panel.
private const int WM_NCLBUTTONDOWN = 0xA1;
private const int HTCAPTION = 0x2;
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int
wParam, int lParam);
private void panel1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
}
This code picks up the Windows setting of whether to show the window
contents while dragging or not.
However, i want to always hide the contents of my window while
dragging. Is there a way to achieve this?
Also, with this code when i try to hook the MouseUp event of my
panel1, i am not able to do so. After i perform a mouse click, the
control doesnt transfer to the event handler.
Solution to either of the problems will be of great help
Regards,
Ankit!