I am trying to make a form borderless which can be resized and dragged.
Well I got two tutorials to do so link1 and link2 (and many more).
The first link has simple reference to System.Runtime.InteropServices with small code and
the second one is calling events like MouseUp,MouseDown and MouseMove with big code.
I tried the two codes which are OK to me. As I am not good in C#, I cant determine which one is good based on performance. please suggest me with which I should go..
Personally, I doubt using Interopservices (because I dont know anything about it).
The code in link1 uses the libraries native to windows and won’t work on other platforms. It may not even work on future versions of windows.
But since the operating system takes control of your form, it requires alot more code to do the same thing using a managed solution, as you can see in link2.
In both cases, you can implement the solution in a base form and inherit from it. Performance wise, link1 would be faster as it does not handle the
MouseMoveevent. But I don’t know if you would ever notice the performance difference.