473,387 Members | 1,687 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Mouseclick

I have a little question. How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.

Thanks

Nov 21 '05 #1
3 1469
In .Net, I don't know if there's a method, but using Windows API, you can
send a message (SendMessage) with WM_LMOUSEDOWN and then WM_LMOUSEUP
messages in the position you want. There's documentation in these two
messages in MSDN library to see how they expect the lParam and wParam of
SendMessage.
Hope this helps.
VBen.

<zo****@yahoo.com> escribió en el mensaje
news:11**********************@o13g2000cwo.googlegr oups.com...
I have a little question. How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.

Thanks

Nov 21 '05 #2
>I have a little question. How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.

Thanks


Not sure with what you mean with 'let my mouse click'...trigger the
functionality in a certain button event? Move that functionality to a
seperate function so you can call it from other places in your code. Handle
the mouse move event, triggering a function when coordinates are 10,750:

Private Sub ControlName_MouseMove(ByVal sender As System.Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles ControlName.MouseMove
.....
If Cursor.Position.X = 10 And Cursor.Position.Y = 750 Then
REM Call function.
End If
.....
End Sub
Nov 21 '05 #3
<zo****@yahoo.com> schrieb:
How can I make that when I click on Button1
that my cursor go to ex. 10,750 and if the position of my cursor is
10,750, than let my mouse click. I know how I got let the cursor to a
position, but I didn't know how I can click with the mouse.


<URL:http://groups.google.de/groups?selm=eqFfJBU%24EHA.2196%40TK2MSFTNGP14.phx. gbl>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: vince | last post by:
Couldn't find a better place to post the question, feel free to direct me to a better place... Needing to automate our application testing using a keystroke/mouseclick recorder for playing back...
2
by: | last post by:
Hi everybody. Need your help. How can I play sound (.wav-file / camera click) on mouseclick? TIA willy wuff ...
3
by: Kubik | last post by:
Hello! How to detect mouseclick anywhere on the form? There is a lot of controls on the form, so I don't want to add eventhandler for each of them. How can I do it in another way? Adam --...
3
by: Hans | last post by:
Hi! In my windowsformapplication I have a DataGrid where the rowheader is not visible, and readOnly = true. The grid is bound to a DataView where AllowEdit, AllowNew and AllowDelete is set to...
4
by: Peter Rilling | last post by:
What is the difference between the MouseClick and Click events?
4
by: Chris Dunaway | last post by:
I added a MouseClick event to a Button control. It responds properly to the Left click of the button, but not a middle click or right click. Is it possible to get a right click and/or middle...
6
by: Kristian Frost | last post by:
Hi, I'm trying to add, as you might guess, mouseclick listeners to the shapes I am drawing using the GDI+ commands in a similar sort of way as could be done with the old VB "shapes". Problem is,...
1
by: JimBob | last post by:
Ok so i added this line of code to a dynamic PictureBox. (i dim it p) AddHandler p.MouseClick, AddressOf Hand.Canvas_Click what it would do is change the pic on the picbox but every time you click...
2
by: GS | last post by:
how can I tell if it is right mouse click from left mouseclick? I would also to test if a key like control is being held down at the same time. what I would really like to is to capture control...
6
by: RolltheBall | last post by:
Hi there. I am trying to make a certain symbol to appear upon every mouseclick. However, the symbol is a cross and an arrow head. This is how I tried to do it. Private Sub Form1_Paint(ByVal...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.