mouse-cursor

How do I create a dynamic mouse cursor .NET without using interop?

强颜欢笑 提交于 2019-12-31 01:45:59
问题 I have an application which I'm interested in eventually porting to mono so I'm trying to avoid using p/invoke's to accomplish this task. I would like to load a cursor dynamically, as in I have a Bitmap that is generated on the fly in the application. From what I can tell the safest way to do it without using p/invoke's is to create a .cur file which I can then load to a memory stream and use the Cursor(Stream) constructor. However I have no idea how to create a .cur file. I found this

Swing: Change cursor to wait cursor

妖精的绣舞 提交于 2019-12-21 16:57:46
问题 See also Java Swing GUI hour glass. However the provided answer does not seem to work. I have following code: private void loadFileMenuItemActionPerformed(java.awt.event.ActionEvent evt) { int returnVal = fileChoser.showOpenDialog(this); if (returnVal == JFileChooser.APPROVE_OPTION) { try { this.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); // do stuff } finally { this.setCursor(Cursor.getDefaultCursor()); } } } This is called when user selects the according entry in the menu bar

How do I determine if the current mouse cursor is animated?

荒凉一梦 提交于 2019-12-21 12:31:24
问题 is there a way how to determine if the current mouse cursor is animated ? I was looking for a way how to save the current cursor some time ago. I found the DrawIconEx function which perfectly suits to my purpose. Unfortunately I don't know how do I determine if the current cursor is animated. I was hoping that if I set the istepIfAniCur parameter to 1 in case of static cursor DrawIconEx returns False but it really ignores that parameter and returns True what disallows me to use it in the loop

When I click on a canvas and drag my mouse, the cursor changes to a text-selection cursor. How can I prevent this?

╄→尐↘猪︶ㄣ 提交于 2019-12-21 04:21:23
问题 Here's a fiddle: http://jsfiddle.net/MZ9Xm/ Note: The following occurs in Chrome 22.0.1221.1, but not in Firefox 14.0.1. [Ubuntu linux] Move your mouse to the top canvas and press and hold the mouse button. Drag the mouse, and the cursor will change to a text-selection mouse cursor (I-bar). This does not happen if there are no other elements on the page. I've messed around with setting user-selection to none, but have not had any luck. 回答1: You can bind a mousedown event in your canvas to

Bad cursor in select/option, IE

拥有回忆 提交于 2019-12-20 01:55:13
问题 I have a problem with bad cursor in options when the text is under that. Normally, the option uses "default" cursor, but when eg. the paragraph is under option, in IE I see "text" cursor. Code: <form> <select> <option value=a selected="selected">First <option value=b>Second <option value=c>Third <option value=c>Fourth </select> <p>text</p> </form> It´s in IE11 and I think the older ones makes the same. I tried to set position: relative and z-index to select, option and paragraph, set cursor

Hide cursor in fullscreen mode using Qt 4.8?

心已入冬 提交于 2019-12-19 17:30:19
问题 I'm in a ArchLinux with OpenBox and I want to hide the cursor on fullscreen inside a Qt 4.8 application. I am aware about some other question about it but no one works every time: sometimes the cursor is hiding, sometimes not. I didn't managed to understand exactly when the problem occurs but I think that maybe is it related with the screensaver because if I test my application just after the computer is restarted the mouse cursor is no visible (and it is what I want) but if I test this

Hide cursor in fullscreen mode using Qt 4.8?

孤街浪徒 提交于 2019-12-19 17:29:50
问题 I'm in a ArchLinux with OpenBox and I want to hide the cursor on fullscreen inside a Qt 4.8 application. I am aware about some other question about it but no one works every time: sometimes the cursor is hiding, sometimes not. I didn't managed to understand exactly when the problem occurs but I think that maybe is it related with the screensaver because if I test my application just after the computer is restarted the mouse cursor is no visible (and it is what I want) but if I test this

How to change the mouse cursor in Objective-C

为君一笑 提交于 2019-12-19 11:51:01
问题 I am making an image editing application, but it looks very incomplete without a cursor like they have in Photoshop for the paintbrush. How can I set the icon, and have it change back when I exit the application? This is the code in my header file (just in case it's needed): @interface test : NSWindow <NSWindowDelegate> { IBOutlet id myView; } @end myView is an NSView (customView) that will display everything. 回答1: There's a handy NSCursor class for handling cursor appearance. If one of the

WPF Wait Cursor With BackgroundWorker Thread

爱⌒轻易说出口 提交于 2019-12-18 06:58:43
问题 I want to show the hourglass cursor and disable the window while a BackgroundWorker process runs in another thread. This is what I'm doing: Private Sub MyButton_Click(...) Dim box As New AnotherWpfWindow() box.Owner = Me ... box.ShowDialog() If (box.DialogResult.GetValueOrDefault = True) Then Me.IsEnabled = False Me.Cursor = Cursors.Wait MyBackgroundWorker.RunWorkerAsync() End If End Sub Private Sub MyBackgroundWorker_RunWorkerCompleted(...) UpdateInterface() Me.IsEnabled = True Me.Cursor =

How to move mouse cursor using C#?

杀马特。学长 韩版系。学妹 提交于 2019-12-17 00:45:10
问题 I want to simulate mouse movement every x seconds. For that, I'll use a timer (x seconds) and when the timer ticks I'll make the mouse movement. But, how can I make the mouse cursor move using C#? 回答1: Take a look at the Cursor.Position Property. It should get you started. private void MoveCursor() { // Set the Current cursor, move the cursor's Position, // and set its clipping rectangle to the form. this.Cursor = new Cursor(Cursor.Current.Handle); Cursor.Position = new Point(Cursor.Position