473,766 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dragging Borderless Forms

Liz

I need to implement dragging a borderless form by clicking/dragging on the
form surface. Using the "standard" approach (setting "CanMove" flag on
MouseDown, moving the form by the delta of the absolute mouse movement,
unsetting the "CanMove" flag on MouseUp) I am getting a lot of "jerky"
movement of the form and can't seem to get it smooth.

I also have noticed that MouseMove seems to fire even when there is no
motion of the mouse at all (?) ... I'm using a wireless mouse; does that
make a difference ?

Can anyone point me to a solution that implements smooth movement of the
form on mouse dragging ? I would think this is a pretty common problem
......

TIA

Apr 21 '06 #1
3 1646
http://www.dotnetrix.co.uk/misc.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Liz" <li*@no-spam.org> wrote in message
news:Ri******** ***********@fe0 8.news.easynews .com...

I need to implement dragging a borderless form by clicking/dragging on the
form surface. Using the "standard" approach (setting "CanMove" flag on
MouseDown, moving the form by the delta of the absolute mouse movement,
unsetting the "CanMove" flag on MouseUp) I am getting a lot of "jerky"
movement of the form and can't seem to get it smooth.

I also have noticed that MouseMove seems to fire even when there is no
motion of the mouse at all (?) ... I'm using a wireless mouse; does that
make a difference ?

Can anyone point me to a solution that implements smooth movement of the
form on mouse dragging ? I would think this is a pretty common problem
.....

TIA

Apr 21 '06 #2
Liz

"Mick Doherty"
<EX***********@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
http://www.dotnetrix.co.uk/misc.html
Works great, Mick .... thank you ... now I have to figure out WHY and HOW
they work ! It appears that the essence of the algorithm is "tricking"
Windows into thinking the user clicked on the title bar rather than the
client area of the form .... (???) .... clever ....

L

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Liz" <li*@no-spam.org> wrote in message
news:Ri******** ***********@fe0 8.news.easynews .com...

I need to implement dragging a borderless form by clicking/dragging on
the form surface. Using the "standard" approach (setting "CanMove" flag
on MouseDown, moving the form by the delta of the absolute mouse
movement, unsetting the "CanMove" flag on MouseUp) I am getting a lot of
"jerky" movement of the form and can't seem to get it smooth.

I also have noticed that MouseMove seems to fire even when there is no
motion of the mouse at all (?) ... I'm using a wireless mouse; does that
make a difference ?

Can anyone point me to a solution that implements smooth movement of the
form on mouse dragging ? I would think this is a pretty common problem
.....

TIA


Apr 22 '06 #3

"Liz" <li*@no-spam.org> wrote in message
news:Vx******** ***********@fe0 1.news.easynews .com...

Works great, Mick .... thank you ...
You're welcome!
now I have to figure out WHY and HOW they work ! It appears that the
essence of the algorithm is "tricking" Windows into thinking the user
clicked on the title bar rather than the client area of the form .... (???)
.... clever ....


That's exactly how it works.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Apr 22 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1562
by: Ludovic SOEUR | last post by:
I do not understand why when a dragging operation is started with DoDragDrop, no exception is handled. The following lines illustrate what I mean. In Form2_DragDrop event, I raise an exception at the line "int b=1/a" (so the message After Exception will not be shown). Why this exception will be unhandled ? using System; using System.Windows.Forms; public class Form2 : System.Windows.Forms.Form {
6
15082
by: Nikki | last post by:
Hi, Can anybody help me in solving this problem. I m developing an application in which the main application form is borderless. now i m not able to move the application form with the help of mouse. Thanks,
1
3443
by: Sagaert Johan | last post by:
Hi While dragging an object onto another, i want to show a tooltip or text balloon that informs the user where it can be dropped. What about showing a 50% opague thumbnail image ? I need some hints to get started. (any samplecode ?) Johan
16
1672
by: Geoff Jones | last post by:
Hiya Could anybody direct me to some examples of code to do the following: Display a bitmap on a form which can then be moved about i.e. dragged, using the left down button of the mouse. Thanks in advance Geoff
2
1427
by: Tull Clancey | last post by:
Does anyone have, or can anyone suggest a URL for code to drag a control around a form at run time? VB.Net 2003. I have written stuff in VB6 to do this before, but a long time ago and I don't have the code to refer to anymore. Cheers, Tull.
0
1306
by: Brian Tkatch | last post by:
Been trying to figure out how to show borderless forms indside an MDI Form, without showing the border at all. Given that (in our case) only one such form needs to show at a time, we were able to put a panel in the (entire) MDI client area and anchor it all around. Then, Show() the panel before opening a form, and after the Form.Show(), do a Panel.Hide(). Panel.BringToFront() and Panel.SendToBack() work just as well. We chose Hide()...
5
2540
by: ThunderMusic | last post by:
Hi I'm currently developping a skinnable form by using a borderless form (Form.FormBorderStyle=None). Is it the right way to go in the first place? if it is. Assuming that when there is no border to the form there is no context menu when you right-click on your form in the start bar too (the one with Restore, Move, Size, Close et al.)... How can I make this context menu work again? Is there a way to tell the form to make it work even if...
3
2206
by: Rick | last post by:
I know I seen this before but IO cannot find it. How to you drag a borderless form in Vb.net 2005
0
10168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10008
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9837
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5279
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3929
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.