Cursor and Picture Box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • MarcosGalarza
    New Member
    • May 2010
    • 6

    Cursor and Picture Box

    Hello,

    I am trying to create a sniper game in visual basic. What i am trying to do is to make the cursor be in the middle of the cross hair at all times. and where ever the cursor moves that is where the scope goes. The picture box is transparent and the background of the scope is black. Its like sniping in call of duty. Someone please help me to make the cursor be in the middle of the cross hair please!
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    The easiest way would be to...
    Code:
    Option Explicit
    
    Private Sub Form_Load()
    Me.MousePointer = vbCrosshair
    End Sub
    If you want a larger crosshair, then you will need to set mousepointer equal to vbCustom and use loadpicture to load your own custom made graphic into the MouseIcon property...



    Good Luck

    Comment

    • Guido Geurs
      Recognized Expert Contributor
      • Oct 2009
      • 767

      #3
      Originally posted by MarcosGalarza
      Hello,

      I am trying to create a sniper game in visual basic. What i am trying to do is to make the cursor be in the middle of the cross hair at all times. and where ever the cursor moves that is where the scope goes. The picture box is transparent and the background of the scope is black. Its like sniping in call of duty. Someone please help me to make the cursor be in the middle of the cross hair please!
      dear,

      There is also a call from you = "PictureBox And MousePosition" in which I explain how to create a cross-hair with a self-made control.

      I have tried it with a picturebox.
      Maybe its my computer (P4 2.6) (not a game computer ! ) but the screen refresh is to slow with a picturebox !?.

      If You want to try it with a picturebox, use the same technique = make a picture in a picturebox ( 2x the size of your application ) and use mousemove like in may attachment.

      br,

      Comment

      Working...