473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

i want to display x and y mouse position of mouse under my windows form application

1 New Member
"I have to text box to display mouse's x and y position i want to display it in textboxes.

I am new IT student i have no idea about this...so any body can help me.."

I Want to Retrive x and y Postion of my mouse arrow, I want to display it in my textboxes.
Attached Files
File Type: zip WebShow.zip (48.7 KB, 47 views)
File Type: zip MousePossition.zip (26.5 KB, 64 views)
Sep 18 '19 #1
1 2482
SioSio
272 Contributor
Add MouseMove event handler.
Expand|Select|Wrap|Line Numbers
  1.         public Form2()
  2.         {
  3.             InitializeComponent();
  4.             //Get Mouse Pointer
  5.            this.MouseMove += new MouseEventHandler(Mouse_Move);
  6.         }
  7.         private void Mouse_Move(object sender, EventArgs e)
  8.         {
  9.  
  10.             //X-ray
  11.             int x = System.Windows.Forms.Cursor.Position.X;
  12.             //Y-ray
  13.             int y = System.Windows.Forms.Cursor.Position.Y;
  14.             this.textBox1.Text = x.ToString();
  15.             this.textBox2.Text = y.ToString();
  16.         }
  17.  
Dec 26 '19 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: forge | last post by:
Installing Merge Modules from C# Windows Form Application (not using a setup and deployment project) Hi, Currently, we have an InstallShield project that creates a setup.exe that only...
1
by: Bruno Alexandre | last post by:
Hi guys, How can I pass session/application values from a web page (ASP or ASP.NET) that is on a host company, into my cliente application? So I can hide menus based on access permisions once...
13
by: Lee Newson | last post by:
Hi, I have just written my first application using VB.NET. The app works fine when i am running it within .NET for debugging purposes, however when i try to run the app from the .exe file that...
5
by: vidishasharma | last post by:
Hi, I have a windows from with few controls over it. Now I have to see if the cursor goes outside the bounds of the windows form then I have to close the form. I added mouse leave for the...
1
by: Prats | last post by:
I have a windows form application developed in C++/CLR How can I verify that only one instance of the application is running on the user system at any given time. Thanks
3
by: subithra | last post by:
how to do session like thing in windows form application to hold the current user in each page where each page can hold that particular user's details who logged in at that time...
5
by: Henrik Söderber | last post by:
Hi! I use C# 4.0 to build a windows form application. I have a Windows Forms Timer that should tick every second. In every tick I do some work (get GPS position, update a map, save to a local DB...
0
by: Wan Fai | last post by:
I am a beginner in C#. I am curious to know how can I display a ListBox outside of Forms Application. For example, there is one software I heard called "Co:Writer" and its actually a ListBox with...
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.