Results 1 to 7 of 7

Thread: [RESOLVED] DragIcon = LoadCursor

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Resolved [RESOLVED] DragIcon = LoadCursor

    The question is simple: How to set DragIcon property to load a (current) Link Select system cursor? LoadCursor API gives only a pointer to the cursor for later usage with SetCursor API. Does anyone know how to utilize that to achieve the goal?
    Last edited by MikiSoft; Jul 30th, 2015 at 03:00 PM.

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: DragIcon = LoadCursor

    You can set it at design time using the properties window or at run time using object.DragIcon = LoadPicture("path_to_cursor_icons\cursor_image_file.cur")


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Re: DragIcon = LoadCursor

    Read my question again. I was asking for loading a current system cursor from the memory, not something from the file. That's why I'm mentioning the LoadCursor API.
    Last edited by MikiSoft; Jul 30th, 2015 at 02:47 PM.

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: DragIcon = LoadCursor

    Another option if you want to use one of the MousePointer constants...
    In the OLEGiveFeedback event of the object being dragged:
    DefaultCursors = False
    Screen.MousePointer = vbHourglass ' for example
    Then in the OLECompleteDrag event
    Screen.MousePointer = vbDefault
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Re: DragIcon = LoadCursor

    Yeah but I want to load a Link Select cursor which has no VB constant. Sorry for that, I've edited the main post to be more clear now.

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: DragIcon = LoadCursor

    If you give this forum a quick search for the following, you'll find a routine that converts icons/cursor handles to a stdPicture object. Once you have that, you can apply the custom image to the drag operation. Search for: OleCreatePictureIndirect

    1. Declare a stdPicture object/variable at top of your form to hold the image returned from OleCreatePictureIndirect. This is set/released in the events below.
    2. In the OLEStartDrag event: create [the stdPicture] object & assign to your form-level variable
    3. In the OLEGiveFeedback event
    DefaultCursors = False
    Set Screen.MouseIcon = [the stdPicture]
    Screen.MousePointer = vbCustom
    4. In the OLECompleteDrag event
    Screen.MousePointer = vbDefault
    Set [the stdPicture] = Nothing ' free some memory

    Thinking above is easy & should work
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2011
    Posts
    461

    Resolved Re: [RESOLVED] DragIcon = LoadCursor

    Thanks for the tip! I found solution here: http://www.vbaccelerator.com/home/VB...le/article.asp

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width