473,383 Members | 1,795 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,383 software developers and data experts.

PictureBox And MousePosition

Hello,

I have made my picturebox move with my mouse, but I am trying to make the cursor stay in the middle of the picturebox while moving the cursor and picturebox. In other words I want the cursor to stay in the middle of the picture box at all times. What I am trying to do is create a sniper game in VB. I want the Cursor to be in the middle of the crosshair.

Someone Please Help Me!
May 7 '10 #1
3 2666
Guido Geurs
767 Expert 512MB
dear,

Just create a *.ico file with a ico editor (like "Icofx" = good freeware) and set the background= transparent.
put it in an imagebox and set visible=no. (see attachment).

set:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.    Screen.MousePointer = 99
  3.    Screen.MouseIcon = Image1.Picture
  4. End Sub
PS: no need to set the hotspot for the cursor : it's default in the center!

Hope this will help You.

br,
Attached Files
File Type: zip PictureBox And MousePosition.zip (2.2 KB, 118 views)
May 8 '10 #2
No its not working out for me, when i try to upload the ico file to me resources it does not show up. See what I am trying to do is for the whole screen to be black except for one part: which is the scope. I dont know if you have played Cod, its just like Cod when you scope into a sniper scope. Thats what I am trying to do.
May 10 '10 #3
Guido Geurs
767 Expert 512MB
dear,


In this case You have to create your own control (see attachment).
His size must be at least 2x the size of your application !!
Use this control in your project (see attachment).

Sorry for the visual shortcomings but the attached examples are roughly and only for testing.
You will need to tune dimensions and shapes.

br,
Attached Files
File Type: zip crosshair_3.zip (5.7 KB, 139 views)
File Type: zip PictureBox And MousePosition_5.zip (201.0 KB, 136 views)
May 11 '10 #4

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

Similar topics

1
by: Scatropolis | last post by:
How do I set the MousePosition? I found MousePosition but it says it can't modified it because it isn't a variable. thanks
3
by: Robert Lochon | last post by:
Hi ! I've got this strange problem : When I press the left-button and move my mouse, my form moves just as intended. But if I make big movements, the cursor shifts slightly. And it ends with...
4
by: Keith Smith | last post by:
I am making a program that needs to put a copy of a certain small image wherever the user clicks with the mouse. I am using a pictureBox as my main area (although I can change this if necessary). ...
0
by: akh | last post by:
I want to use de Drag and Drop ´s event to move a picture box from a form and within a Picture Box. But I have behaviour if the MyPBox As PictureBox as the Globale varible or not Thanks for...
3
by: Tom | last post by:
I have a picturebox on my VB.NET form. The picturebox size mode is set to stretched. I then load an image into that form and display it. As the user moves the mouse over the form, I want to get and...
1
by: cmac89 | last post by:
Dear Group, I wonder if anyone can help me with a little VB.NET picturebox problem? I want to let the user click on a map and where they click I want to draw a circle. I'm using the...
7
by: iwdu15 | last post by:
hi, im trying to egt a picturebox to follow the mousecursor around in a certain area, but the picturebox isnt where the mouse is...how can i get the picturebox to be where the mouse cursor is?...
4
by: munibe | last post by:
Hi, i have a problem about picturebox control. if you may help me, i will be so happy. i have a picturebox named pic_map, and i added a button named customer_button, my wish is to add a new small...
5
by: AWW | last post by:
XP VB 2005 running an example from help that creates a picturebox in code - the picturebox is not created. If I comment out the "Dim Box as New PictureBox" and create it in Design mode - the...
2
by: ducttape | last post by:
Hello I'm busy working with an MDI parent and child forms. I've found that there is a discrepancy between the locations returned by DesktopLocation, Control.MousePosition and MouseEventArgs...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.