 |
|
|
 |
|
 |
Its a great piece of code, in two very simple steps i could my form.
thank you!
|
|
|
|
 |
|
 |
5 from me. Next app will be add your code.
Dream it, Do it.
|
|
|
|
 |
|
 |
This is awesome man!!! you did me a big favor with this! Thank you!!!
|
|
|
|
 |
|
|
 |
|
 |
Great article, small and straight to the point! thanks!
|
|
|
|
 |
|
 |
Both WPARAM and LPARAM are 8B on Windows x64 - therefore int is small and your program fail on such a system when using 64bit .NET framework. You should use IntPtr for wParam and lPARAM too.
|
|
|
|
 |
|
 |
hi,,,
i hve to write a code to move on next FORM from current FORM
can u give me any idea about
thanks....
|
|
|
|
 |
|
 |
oppps actually i want to load my Next FORM in a diffierent way
simply how could i send a variable value in current form to my next form in my desktop application
|
|
|
|
 |
|
|
 |
|
 |
You r owesome..
U had saved my life.
It is perfectly working.
Thanking you again
i want to add combobox and dtpicker into datagrid
|
|
|
|
 |
|
 |
Insert your code in the mouse move event function and it will probably work fine with an additional double click event function
See Microsoft MSDN.
|
|
|
|
 |
|
 |
Hi!
Thanks for your tip! It might be useful for me or someone else in future!
Bye
FreewareFire
|
|
|
|
 |
|
 |
like me, many many thanx!
is this calling an API?
|
|
|
|
 |
|
 |
how can i handle move compleated... MouseUp event did not fired after move compleated. Move & LocationCnanged events raises on every small location changes. i need to know when user release mouse button.
|
|
|
|
 |
|
 |
Did you find a solution to the problem of the MouseUp event not being triggered?
I capture the mouse, from my WPF ListView, but my MouseUp event is not called if I release the mouse button outside the listview. So I do not get the opportunity to call ReleaseMouseCapture.
I have tried using the AddHandler() with the last param set to TRUE for both MouseUp and PreviewMouseUp.
I have tried both MouseUp and PreviewMouseUp.
craigk
craigk
|
|
|
|
 |
|
 |
Hi, your article wasn't meant to solve this, but you might know the aneswer.
I have to apps, one that is running, and my own. I'd like to move the window of the other app.
How to do it? I am sure that interop can help here.
CUIN Kaczy
|
|
|
|
 |
|
 |
Well, hi!
Sorry, was on Holiday - you might try to play with some Api Code. Try SetWindow... Or try SendMessage - so you may be will be able to set new window position...
Greets! FreewareFire
FreewareFire
|
|
|
|
 |
|
 |
Nice article. I currently use yet another method to move a window without the titlebar and it doesn't use interop:
private Point distanceFormMouse;
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
switch (e.Button)
{
case MouseButtons.Left:
distanceFormMouse = new Point(MousePosition.X - this.Location.X, MousePosition.Y - this.Location.Y) ;
mouseDown = true;
break;
}
}
private void Form1_MouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
if(e.Button == MouseButtons.Left)
{
this.Location = new Point(MousePosition.X - distanceFormMouse.X, MousePosition.Y - distanceFormMouse.Y);
}
} and it works well, but I have a problem:
I have a form with this.FormBorderStyle = FormBorderStyle.None; and I
would like to display the standard shortcut menu that usually pops up
when the user right clicks on a application button in the taskbar (the
one with Restore, Move, Size, Minimize, Maximize & Close buttons)
How can I do this? Any suggestion is highly appreciated
It would be great to add some custom entries to the menu (as winamp
does, see sceenshot) but maybe I'm asking too much.
It would be cool if you could update your article to include everything a dev must know when working with forms without the titlebar (move/resize/menu in taskbar/anything else)
Jocker
_______
JeniuS - the file Organizer
|
|
|
|
 |
|
 |
Well, of course i could, but i don't update due the simple reason: It would pass the Topic! Topic is "Move window/form without Titlebar in C#" - and that's it. All other would not fit to topic. There a other Topics explaining your problems - try searching or look at the Forums.
Greets
FreewareFire
FreewareFire
|
|
|
|
 |
|
 |
It would pass the Topic! Topic is "Move window/form without Titlebar in C#"
I wonder why you wrote this article since this problem is easy to solve and several solutions exist ranging from managed code to api calls.
I think that an article that aim to be useful, should include something that solve non-trivial problems or problems that require a bit of research.
There a other Topics explaining your problem If you say so, I guess you have found one: can you give me a link?
I've searched a lot on Usenet and on the Internet and found no solutions. I asked on a couple of forums but no luck. Thank you
_______
JeniuS - the file Organizer
|
|
|
|
 |
|
 |
I simply wrote my own context menu and provided a small PictureBox - OnClick, show menu, go from there...
|
|
|
|
 |
|
 |
Here's a nother technique that gives you much more control. Trapping the WM_NCHITTEST windows message is the key solution here. class PeriodPanel: Panel { private const int WM_NCHITTEST = 0x0084; private const int HTTOP = 0x000C; private const int HTBOTTOM = 0x000F; private const int HTCAPTION = 0x0002; private const int MOUSEAWARE_BORDERWIDTH = 4; // we can play with this protected override void WndProc(ref Message m) { // Default behaviour base.WndProc(ref m); // Trap the message sent when the mouse is over the borders if(m.Msg == WM_NCHITTEST) { int pos = m.LParam.ToInt32(); short yPos = (short)(pos >> 16); short xPos = (short) pos; Point pt = this.PointToClient(new Point(xPos, yPos)); // over the bottom border? if(pt.Y > Height - MOUSEAWARE_BORDERWIDTH) { // HTBOTTOM to resize the panel using the bottom border m.Result = new IntPtr(HTBOTTOM); } else if(pt.Y < MOUSEAWARE_BORDERWIDTH) // over top border? { // HTTOP to resize the panel using the top border m.Result = new IntPtr(HTTOP); } ... and you can return HT_CAPTION to be able to drag the form no matter where the mouse is, over the form. You would have m.Result = new IntPtr(HTTOP) ... instead... } } Hope this helps. Sorry for the format. A quick and dirty paste ! This is typical old windows programming by the way. Richard B. Richard
|
|
|
|
 |
|
 |
Opps! last line of code should show... ... and you can return HTCAPTION to be able to drag the form no matter where the mouse is, over the form. You would have m.Result = new IntPtr(HTCAPTION ) ... instead... Ciau! Richard
|
|
|
|
 |
|
 |
Hey i was wondering if there's some kind of trick which would allow to resize form without frame. I could use that in my customized window. Any reply would be welcome
Phervers
|
|
|
|
 |