vb.net crosshair cursor...

Discussion in 'Microsoft VB .NET' started by Pj, Apr 7, 2005.

  1. Pj

    Pj Guest

    hi,

    i have the following code for drawing a crosshair cursor & it works:

    'Custom cursor
    'Declare bitmap
    Dim bm As New Bitmap(64, 64)
    'Declare graphics
    Dim g As Graphics = Graphics.FromImage(bm)
    'Clear the graphics
    g.Clear(Color.Transparent)
    'Declare cursor pen and set colr + width
    Dim myCursorPen As Pen = New Pen(Color.White, 2)
    'Draw cross hair
    g.DrawLine(myCursorPen, 32, 0, 32, 64)
    g.DrawLine(myCursorPen, 0, 32, 64, 32)
    'Dispose the graphics
    g.Dispose()
    'Declare a cursor object
    Dim cur As New Cursor(bm.GetHicon)
    'Set the cursor object
    Me.Cursor = cur

    the problem is that its 64*64 and i cannot increase it. how can make
    it to 500*500?? if i try it does not work!

    any ideas?

    thanks
    pj
     
    Pj, Apr 7, 2005
    #1
    1. Advertisements

  2. "Pj" <> schrieb:
    > i have the following code for drawing a crosshair cursor & it works:
    >[...]
    > the problem is that its 64*64 and i cannot increase it. how can make
    > it to 500*500?? if i try it does not work!


    Instead of using a cursor, hide the cursor and draw the crosshair on the
    desired position onto the form/control.

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://classicvb.org/petition/>
     
    Herfried K. Wagner [MVP], Apr 7, 2005
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom Spink

    Re: vb.net changing mouse cursor

    Tom Spink, Sep 10, 2003, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    1,229
  2. Christian Blackburn

    How can I set the cursor position in VB.NET

    Christian Blackburn, Sep 19, 2003, in forum: Microsoft VB .NET
    Replies:
    3
    Views:
    1,308
    Christian Blackburn
    Sep 19, 2003
  3. Bernie Yaeger

    me.cursor v me.parent.cursor

    Bernie Yaeger, Mar 16, 2004, in forum: Microsoft VB .NET
    Replies:
    2
    Views:
    264
    Bernie Yaeger
    Mar 16, 2004
  4. Henry Wu
    Replies:
    1
    Views:
    2,396
    Supra
    Jun 17, 2004
  5. BrianDH

    Date-Time, Win Form VB.Net Cursor placment

    BrianDH, Aug 9, 2004, in forum: Microsoft VB .NET
    Replies:
    0
    Views:
    261
    BrianDH
    Aug 9, 2004
  6. Ajit
    Replies:
    2
    Views:
    1,149
  7. nick haddad via DotNetMonster.com

    creating a simple crosshair in VB.Net

    nick haddad via DotNetMonster.com, Jan 16, 2005, in forum: Microsoft VB .NET
    Replies:
    2
    Views:
    1,093
    Herfried K. Wagner [MVP]
    Jan 16, 2005
  8. Smokey Grindle
    Replies:
    2
    Views:
    719
Loading...