Show Some Label When Mouse Pointer Passing At Some Area
Apr 6, 2009i'm writing an application that using a picture-box (raster image, like a map).I want to show some label when my mouse pointer passing at some area.
View 3 Repliesi'm writing an application that using a picture-box (raster image, like a map).I want to show some label when my mouse pointer passing at some area.
View 3 RepliesI am developing an application with multiple picture boxes, each displaying a line graph. I want to be able to have a label following the mousepointer showing xy coordinates of the point. I also want to allow a user to zoom in on a specific picture box by double clicking on it. The code does what I want as written (changes backcolor so I know double click event fires) except moving the position of the label to follow the mouse pointer.
However if if uncomment the line in the MouseMoved sub:
LB.Location = New Point(e.X, e.Y)
Then the label moves as desired however the double click event no longer fires.
Public Class Form1
Dim PB As New PictureBox, LB As New Label
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Controls.Add(PB)
With PB
[Code] .....
I'm trying to make some autohide panels, which will show when mouse enters some area, and hide when mouse leaves the panel. This is however not so straight forward. I can handle MouseMove event for the form, to trigger "show" panel, and I can handle MouseEnter event for the form, to trigger "hide" when mouse leaves the panel. But this is not consistent, since sometimes mouse will leave the panel directly onto another control, and sometimes it will leave the panel directly "from" a control on the panel, and not from the panel itself.
Of course I could do the slow work and make logic for each control, but that is not very neat. Is it possible in some way to capture the mousemove event regardless of which control mouse is above?
I've been working on a GUI in WPF which I'm fairly new to, having only used Windows Forms up until now. So far, my GUI is very simple: it contains two rectangles, each of which drops a shadow. The shadow creates an effect of rectangles "floating above the canvas" so to speak.
When one of the rectangles is pressed, the myRectangle.MouseDown event is handled such that the shadow goes away, thus creating an effect of the rectangle being pressed down onto the canvas, like a button.Similarly, when mouse button is released, the myRectangle.MouseDown event is handled such that the shadow reappears and the rectangle "floats" again. This behavior make them resemble buttons. Note, there a reasons I want them to be rectangles and not custom buttons.
[Code]...
If the pointer leaves a rectangle while mouse button is pressed, I'd like shadow to reappear. This is arguable simple, because theoretically in this case, any time myRectangle.MouseLeave is raised, the shadow should come back on, even if it was already there.If the pointer left a rectangle when mouse button was pressed, then came back while before the button was released, I want the shadow to disappear again. This one is what gives me problems. No idea how to do this.
In IE firefox and other webbrowser when your mouse is over a link/image/email the url of it is shown in the webbrowser before you click on that link
View 2 RepliesWhat is the code for Hiding a mouse and make it go back when going to
Desktop1.vb
Cursor.Hide()
works
Cursor.Show()
is not working when going to Desktop1.vb .vb its still hiding what am i doing wrong here is my code.
[Code]...
Private Declare Function src_simple Lib "libsamplerate.dll" (ByVal data As IntPtr, ByVal converter_type As Integer, ByVal channels As Integer) As Integer<br/>
Private Declare Function src_strerror Lib "libsamplerate.dll" (ByVal err As Integer) As IntPtr<br/>
<br/>
<StructLayout(LayoutKind.Sequential, Pack:=1)> _
[code]....
How do I change my mouse cursor/icon to use a image or icon. I want to make a simple "wack a mole" type game but I dont know how to change the pointer to a icon or at least get a image to follow the pointer.
View 7 RepliesI want to know which mouse pointer is selected anywhere in windows (so also outside my application).
I've looked into Cursor.Current but I can't figure it out. Perhaps someone here can tell me how it's done?
I am attempting to hide the mouse pointer when there has been a few seconds of inactivity and then re-show the pointer again when the user moves the mouse. I have been able to get the mouse pointer to hide and re-show as I require it, however when I execute grid.Children.Clear() and grid.Children.Add() the mouse pointer re-appears (but again hides after a few seconds of inactivity).
My code is as below:
Private Sub Window1_MouseMoved(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseMove
[code]....
Change mouse pointer on Timer_Tick? [code]...
View 6 Repliesi want to make a custom mouse cursor but I found that can be hard so I want to go the next best route. I want to see how you make an image follow the mouse pointer. I assume it would use some kind of image = mousepinter new point (x, y) or somethign like that. Suggestions or samples? In the end i want to take this code snippet and make a duck hunt game and a whack a mole type game
View 10 RepliesAny one know an alternative way to draw the screen to a bitmap without using the copy screen function.Trying to avoid locking up the mouse pointer.
View 3 RepliesI have a problem in a vb.net windows application.I have a form with Sizable form border style. but i want to resize it only from TOP & BOTTOM. I have done the code for this.
But when i move the mouse on form's RIGHT & LEFT border, the mouse pointer gets changed to resize mode. When i drag it form size does not change. but when i try to resize it from LEFT whole form moved to LEFT. I do not need it.
I'm trying to move the mouse pointer to a certain position on the screen.I've done the declarations for both the SetCursorPos as well as the mouse_event, however I keep getting a Declaration expected error at this line: SetCursorPos(x,y),Perhaps something is wrong with the project or vb as well, cause I used an other declaration as well and when I wanted to use that I also got a Declaration expected error.[code]....
View 2 RepliesI would like to know how can i change the panel location where my pointer points?
View 9 RepliesI have a combobox that drops up instead of down. I'm setting the selected item to the one on top of the list. I'd like to move my mouse pointer to point to it, so that the user that wants to click on that item doesn't have to move his mouse. I found how to move the pointer, it is with this command:
Windows.Forms.Cursor.Position = New System.Drawing.Point(x,y)
but I need to know how to get the location of the selected item in the combobox.
I have a program that has two list boxes. I want to have the user right click either listbox and remove an item using the context menu option. I have tried to use GetChildAtPoint (control.mouseposition) but I cannot return a control the mouse is over. I then tried to use the _Click event of the context menu to get the sender, but the sender is the contextmenu control. Here is the code I am using:
Dim ctrl As Control = Me.GetChildAtPoint(Control.MousePosition)
If ctrl Is Nothing Then
Exit Sub
[Code]....
Is there a code in which the software scans the screen and point a specified color out of that scan and mark it.
View 1 RepliesI have a main form "Parent" and another "child" form. When I am filling a textbox in the child form the mouse pointer disappears. Then I hit the tab key to jump to a combobox. At this time when I move the mouse, the pointer doesn't come up until I click the mouse button. This is annoying and the user of my program doesn't like it. How can I keep the mouse pointer always on top. NOte: although the main form has the parent property as true, the other child form are not defined as child forms.
View 2 RepliesI want to make a small application for my web designing needs that will display the color of the current pixel under the mouse pointer. I need this to work on the entire screen (no matter what form/application is in focus) and it needs to update in real time.
I'm not worried about the math or working with coordinates, but I don't know (and can't find) anything that might get the color of the pixel under the cursor on any form. I've found a small number of VB6 examples, but I'm with .NET 2008. Does anyone know of a method or anything (DLL even >.<)
Pressing a Hotkey, I want to click the button of another application (a game table), knowing it x and y coordinates, without to move on the screen then mouse pointer, because this generate an annoyng fluttering.atm I use mouse_event, that works fine, but with the fluttering..In you opinion is this job is possible with a direct Api? I tried to hide the mouse with ShowCursor(False), but it works only over my forms, not over the screen...
View 2 RepliesI have three TextBoxes, how can I let the pointer show in the TextBox2 when I load the Form I treid this but didn't succeed
Me.TextBox2.Focus()
I am using Vb.NET to build a windows application. In menu-strips by default the submenus will appear on clicking on the menu items. I am willing to display the submenu items by hovering the cursor on menu items. What is the procedure to do that?
View 1 RepliesAnyone know why the Mouse_Leave event fires when you don't leave the control with the mouse pointer?Put a large button on a Form so your mouse pointer does not leave it easily.Then try this codeWhen you do, leave the mouse pointer in the middle of the button and then click the button.By the way, if you uncomment the 1st line of code in the Button Click event and comment out the MessageBox, this does not happen.Can someone please explain this behaviour?
Option Strict On
Option Explicit On
Option Infer Off
[code].....
I have a vb.net application, and I want to know how to find the coordinates of the pointer (mouse) when it is clicked on the form. Not much else to say, so I'll leave it like that.
View 3 Replieshow do i check if a mouse was clicked in a specific coordinate plane on the form"?
View 2 RepliesI am trying to make a user control that can me moved around the form with the mouse.The control will look similar to this ...This is an example of my code for moving the control around.
Private Sub JobBox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles JobBox.MouseDown
x = e.X
[code].....
i am trying to get a project that will magnify the area of the screen under my mouse... and be displayed in the applacations window! so far all i have been able to do is track the X, Y positions of my mouse... i have some experiance but not very much useing visual basic.
View 6 RepliesI've read many articles on how to create transparent labels but it seems to me that my particular case is not covered. Very simply I have a label placed in the upper right part of the form, which in fact is part of the menu strip. The label displays some info to the user but I wish it were transparent. I've tried various methods including
lblAct.Parent = mnuMain '(or Me)
lblAct.BackColor = Color.Transparent
lblAct.BringToFront()
But cant get it to work. How I can make that label in that position transparent?