drag

Drag borderless windows form by mouse [duplicate]

房东的猫 提交于 2019-11-27 09:08:06
Possible Duplicate: C# - Make a borderless form movable? I have made a form without border in C#, by setting this.FormBorderStyle = FormBorderStyle.None; Now, problem is how can I drag it by mouse? This should be what you are looking for "Enhanced: Drag and move WinForms" public partial class MyDraggableForm : Form { private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2; /// /// Handling the window messages /// protected override void WndProc(ref Message message) { base.WndProc(ref message); if (message.Msg == WM_NCHITTEST && (int)message

How to catch that map panning and zoom are really finished?

混江龙づ霸主 提交于 2019-11-27 05:30:20
问题 I am trying to write an application that will dynamically load data to map while user pans or zooms it. I need to track when the map is finished to change its view state (stops panning or zooming) and then load a new portion of data for creating markers. But in fact Google Maps API doesn't have any events to handle this. There are some methods like creating an empty overlay to control onTouch events and so on, but map panning could last long after user finished his touch because GMaps use

How to drag a UserControl inside a Canvas

痴心易碎 提交于 2019-11-27 00:45:03
I'm writing my first WPF application. I have a Canvas in which user can add UserControl subclasses containing a form. User should be able to drag these UserControl around the Canvas. What's the best practice to do this with WPF? Thanks. Corey Sunwold This is done in silverlight and not in WPF, but it should work the same. Create two private properties on the control: protected bool isDragging; private Point clickPosition; Then attatch some event handlers in the constructor of the control: this.MouseLeftButtonDown += new MouseButtonEventHandler(Control_MouseLeftButtonDown); this

How to set the Origin (drag.origin) for drag behavior in d3 JavaScript library

落爺英雄遲暮 提交于 2019-11-26 23:16:48
问题 I am trying to implement drag behavior for group consisting from HTML-text and background-rectangle using the d3 framework. I was able to get it working, although when not setting the drag.origin I can see noticeable jump due to the mouse-position/element-coordinates offset. Exactly how described on the d3 wiki-page Although the page described how to set the Origin for dragging, I do not properly understand how ti implement it in my example. I tried two different approaches : using the

chrome sets cursor to text while dragging, why?

廉价感情. 提交于 2019-11-26 22:18:21
My application has many drag and drop features. While dragging I want the cursor to change to some grab cursor. Internet Explorer and Firefox work fine for this, but Chrome always changes the cursor to the text cursor. None of these solutions worked for me because it's too much code. I use a custom jQuery implementation to do the drag, and adding this line in the mousedown handler did the trick for me in Chrome. e.originalEvent.preventDefault(); Try turning off text selection event. document.onselectstart = function(){ return false; } This will disable any text selection on the page and it

Touch and drag image in android

前提是你 提交于 2019-11-26 20:21:26
I am working on some example in which i want to drag the image corresponding to touch in Android. Does anybody have an idea about how I can do it? SBK public class TouchBall extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); int w=getWindowManager().getDefaultDisplay().getWidth()-25; int h=getWindowManager().getDefaultDisplay().getHeight()-25; BallView ballView=new BallView(this,w,h); setContentView(ballView); } } public class BallView extends SurfaceView implements SurfaceHolder.Callback { private Bitmap bitmap ; private

D3.js: Remove force.drag from a selection

假如想象 提交于 2019-11-26 17:49:04
问题 I have a (rather simple) question: How to "un-call" force.drag on a selection made by D3.js? Let's say I created a set of elements and called "call" on it, giving it the drag-callback of a force-directed layout. That looked like this: d3.selectAll('rect').call(force.drag); Now it shall be possible to remove that behavior from some of the nodes later on. My approaches included resetting various listeners, such as 'click', 'drag' etc. using d3.select('rect#no-drag').on('click', null); None of

How to get notified of UITableViewCell move start and end?

时光毁灭记忆、已成空白 提交于 2019-11-26 15:46:02
问题 I have a UITableView in my iOS app that gets refreshed periodically. The user is also able to move the tableview rows at all times (the tableview is always in editing mode). I want to stop the refresh timer when the user starts dragging a row and start it again when the row is dropped. The last part should be easy with moveRowAtIndexPath , but how to get notified about drag start? 回答1: Your UITableViewDelegate will receive the following notifications in response to reordering actions: - (void

How to use UIPanGestureRecognizer to move object? iPhone/iPad

流过昼夜 提交于 2019-11-26 15:45:27
There are several examples of the UIPanGestureRecognizer class. For example I have read this and I am still not able to use it... On the nib file that I am working on I have a UIView (white rectangle on image) that I wish to drag with that class: and in my .m file I have placed: - (void)setTranslation:(CGPoint)translation inView:(UIView *)view { NSLog(@"Test to see if this method gets executed"); } and that method does not get executed when I drag the mouse across the UIView . I have also tried placing: - (void)pan:(UIPanGestureRecognizer *)gesture { NSLog(@"testing"); } And that method does

JFreechart candlestick chart weird behaviour on drag

ε祈祈猫儿з 提交于 2019-11-26 15:30:32
This is a follow up question from this question . What happens is the following: When I launch the graph and I drag the graph around, something weird happens: at a certain interval, it seems every 7 periods, the candlesticks get smaller and smaller untill they are only a stripe. Then when I drag further, they become thicker again until they are normal size again. This seems to happen for every 7 periods. An example of this phenomenon is displayed on to the following 3 pictures: The following code will show exactly what I mean. Just compile and run it. Then press and hold CTRL and click and