How to make a border less form draggable inside specified location in .net?
-
I have a requirement of enabling drag option for border less form within a fixed location of screen. I am reading the windows explorer’s position for this method. Then I will place an icon within window’s explorer window and planning to allow dragging of that form everywhere inside the windows explorer. How to do this ?
-
I have a requirement of enabling drag option for border less form within a fixed location of screen. I am reading the windows explorer’s position for this method. Then I will place an icon within window’s explorer window and planning to allow dragging of that form everywhere inside the windows explorer. How to do this ?
I'm not clear on what you describe here. You find the current position of Win Explorer ... what if there are multiple folder views open ? You move an icon within a Win Explorer window ... how do you keep it on top ? What is the borderless Form you refer to ... what is its relationship to the icon, or the Win Explorer window ? Making a Windows Form draggable is easy; how do you want the user to start dragging it ... by click-dragging anywhere on the Form not covered by a Control ? by clicking on some visual indicator ? by clicking on a certain region in the Form ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
-
I'm not clear on what you describe here. You find the current position of Win Explorer ... what if there are multiple folder views open ? You move an icon within a Win Explorer window ... how do you keep it on top ? What is the borderless Form you refer to ... what is its relationship to the icon, or the Win Explorer window ? Making a Windows Form draggable is easy; how do you want the user to start dragging it ... by click-dragging anywhere on the Form not covered by a Control ? by clicking on some visual indicator ? by clicking on a certain region in the Form ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008
BillWoodruff wrote:
You find the current position of Win Explorer ... what if there are multiple folder views open ? You move an icon within a Win Explorer window ... how do you keep it on top ?
I manage multiple windows with the handle of the window. See my previous question. I am keeping the form on top of explorer by setting "me.topmost" property. I want to allow dragging of form on mouse left click down everywhere inside the form but that form should be draggable within specified location of window (i.e within windows explorer window)
-
BillWoodruff wrote:
You find the current position of Win Explorer ... what if there are multiple folder views open ? You move an icon within a Win Explorer window ... how do you keep it on top ?
I manage multiple windows with the handle of the window. See my previous question. I am keeping the form on top of explorer by setting "me.topmost" property. I want to allow dragging of form on mouse left click down everywhere inside the form but that form should be draggable within specified location of window (i.e within windows explorer window)
You still have not clearly explained what the use of the Icon and the Form is
Quote:
I want to allow dragging of form on mouse left click down everywhere inside the form but that form should be draggable within specified location of window (i.e within windows explorer window)
This statement implies you have two Forms, and that one is dragged within the bounds of the other. Please try and describe clearly what you are trying to achieve, and, why are you trying to change the appearance of what the user sees in an Explorer Window ? Describe exactly what your app creates. The use of "me.topmost" suggests this is a VB Project ... is that correct ?
«There is a spectrum, from "clearly desirable behaviour," to "possibly dodgy behavior that still makes some sense," to "clearly undesirable behavior." We try to make the latter into warnings or, better, errors. But stuff that is in the middle category you don’t want to restrict unless there is a clear way to work around it.» Eric Lippert, May 14, 2008