Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Disappearing MouseIcon

I have put together an OCX which has a PictureBox used as a Split Control to resize the Control. I have set the PictureBox MousePointer to 9.

This works fine and it looks really good. However, the mouse after a while doesn't show the Icon, this normally occurs when a new form is loaded.

Does anyone know why or is there a more reliable way to acheive this.

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
I have a custom mouseicon, and on the forms MouseDown event I would like the cursor to change. I've looked into MouseIcon Properties, but there doesn't seem to be anything to change it. Can anyone help??

Also, the icons I want to load, are already on my form....
I don't want to load from a directory


Well, orbit just told me i need my icon to be less then 16 color format to stick it as i icon and i feel like going against the system so im gunna ask ya'll if you know of a way i can stick a pretty 256 color cursor icon in there. Is there a pretty patch i can dl or something?

This would help alot.

MouseIcon Only In B/w
When I want to use *.cur or *.ico - files as MouseIcon the
MousePointer is always displayed without colour.
I've tested this in VB6, and aswell in VB4, but it won't work
Any solution ?

Thanks, Matt-D

Good Day,
I'd like to ask how can I display the very same MouseIcon(the Hand icon) used in Internet Explorer. I can't seem to find the cursor / icon file for this mouseicon.


how i can use a colored MouseIcon(*.cur) in VB 6.

I have trying but the Color of the MouseIcon get Black !!!

Thank You !!!

The People must die because they can't connect the End with the Start
Thales from Milets 600 b.Chr.

Mouseicon From Imagelist
How can i load custom mouseicons from an imagelist in runtime.

I'm making a paint program, with pencil, eraser, ... and i have an image list with the icons. I want to use them as mouse cursors but how ?

Thanks in advance

Property Get&Let MouseIcon
add new property in usercontrol to handle mouseicon.

the code:

Public Property Get MouseIcon() As IPictureDisp
Set MouseIcon = UserControl.MouseIcon
End Property

Public Property Let MouseIcon(ByVal NewIcon As IPictureDisp)
UserControl.MouseIcon = NewIcon
End Property

the Error:
wrong number of arguments or invalid property assignment

I need to add this Property in my usercontrol, but I cant get it to work.

MouseIcon Problem
I'm trying to add a custom cursor for when I have my mouse over a command button. In the properties for the button, I've set MousePointer to 99-Custom, but when I try to add my own .ico or .cur file with the MouseIcon property, it comes up with the message 'Invalid File' and does nothing.
Any tips?

MouseIcon Question
1. How do I get the hourglass to appear on the screen without using Form.MousePointer as that is not working.

That will only work with the object that your use it against (i.e Me.MousePointer will be the form). Also, if you have changed your system icons, it may look different, as the MousePointer is loaded from your personal config.

MouseIcon Problem (vb6)
I'm trying to add a custom cursor for when I have my mouse over a command button. In the properties for the button, I've set MousePointer to 99-Custom, but when I try to add my own .ico or .cur file with the MouseIcon property, it comes up with the message 'Invalid File' and does nothing.
Any tips?

How To Get Popupmenu & Mouseicon?
In a listbox there are several names.i want to select the particular name and delete the name using popupmenu,while selecting the particular name I need mouseicon,the name which is deleted should be deleted in my database

MouseIcon Property
hay, im having some problems with the syntax for changing the mouseicon property when a user double clicks on a flexgrid. i have tried a number of different ways including;

grid.mouseicon [ = c winntcursorssize3_rm.cur] and
grid.mouseicon = loadpicture(cwinntcursorssize3_rm)

and nither of them are right. if ne1 could help me it would be really great



Treeview MouseIcon
How do I change the mouse icon with a treeview. It wont accept just a number. There is probably a library of acceptable values. Do you know it ?

How To Set MouseIcon To OCR_HAND
I have a label control which I wasnt to set the MouseIcon property to user the OCR_HAND cursor.

I can get a handle to the cursor using


Public Const OCR_HAND = 32649
Public Declare Function LoadCursor Lib "user32" Alias "LoadCursorA" (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long

I have also set the MousePointer to 99 'Custom

But how do I put this curosr into the MouseIcon property of the label?

Dumb MouseIcon Question
I'm trying to get my MouseIcon to change between several different Icons. To change it between vb standard pointers and one custom icon, I'd use the MouseIcon property of the control and switch pointers between (some number) and vbCustom. But is there some way, other than loading paths into MouseIcon to get the job done for several custom icons.
Using the imagelist would make me happiest.

Tried Volpe's suggestion

Set Control1.MouseIcon = imlSmallIcons(NewIcon).Picture
Control1.MousePointer = NewPointer

but can't get it to work.

Change MouseIcon At Runtime?

I would like to know, how I can use selfmade MouseIcons and change them at runtime.
I know about this: Mousepointer = 11 (for example) But I want several different selfmade-mousepointers.
I also know that you can choose a special mousepointer while designing your program, but as i said before I want to change it at runtime.
All right, I hope you get my point, thank you for reading this.

MouseIcon Property Problem
In a picturebox, I am trying to use a custom mouse pointer. And I am changing the picturebox mousepointer property to custom and assigning an icon file to mouseicon property, but in my progam, my custom mouse pointer is getting bigger than is to be (look at attached picture)

Why is this happening?

Mshflex Grid.MouseIcon
I have a small mshfelxgrid control , certain actions put small images into some of the cells. How can change the mouse pointer like on command buttons.
This does not work:
Mshflegrid.MouseIcon = LoadResPicture(101, vbResIcon)
I get "Invalid use of property"

[vb6]Need Some Help With Coding(game) & Mouseicon
I just joined this forum hoping to learn more about vb and how to code programs better. I know the basics, i have compiled several .exe's and .ocx's before but they were straight from a textbook.

Coding Help
Im trying to make a small game where this figure (an image) attacks a monster(another image), i have created all the frames but i just dont know how to set up an attacking command. So that once the player is within the certain area of attack and he presses the space bar(atk button) he hits the monster then ill add the series of dieing frames.

Also How would i go about having an image change over a short period of time when the mouse is over that image (like when my mouse moves over a image it changes to the next image kinda like a .gif)

Custom Mouse Icon Problem
Anyways, Im having a problem loading my mouse cursor. It was originally saved as a .png with a transparent area in it. I used a program called "icon craft" to convert it which worked fine until vb rejected it as a working icon/cur.
I then used "Imagicon" and vb accepted it but the transparent area became black. So any idea's to fix this problem


Ps. for the record i did search first, but the icon things i found didnt tell me a program name to convert images they just gave me the code to add the custom cursors =/

MouseIcon / MouseCursor<ReSolved>
Hi Guys,

I want to load a Picture to the Mouse once it's moved to a certine dimention within my form but with certaine MouseIcon.

VB Code:
dim MyIcon as string myicon = "Picture Path.ico"Object.MouseIcon = LoadPicture(Myicon)Object.MousePointer = 99

However, this code is working fine without any problem in loading the picture. But what I want to user is instaed of an .Ico using a Cursor. I've chaned the path to a Cursor Picture but it won't be load ed.

Any one could help with this issue ??


Why Cant I Set A Mouseicon To An Image Control?
when i set the mouseicon property in an image to a cursor file, it still doesnt appear when i mouseover the image, either in debug mode (in visual basic run) or compiled..

the cursor im trying to set is

any ideas?

RESOLVED: Animated MouseIcon
I have made myself an animated mouse icon. I have set the mouse pointer value to 99-custom, but it won't accept my animated icon (hourglass.ani)

Could I use API to get this to work?

Thanks for your help,

[SOLVED] Screen.MouseIcon
I found the answer. It's just a matter of processing the WM_SETCURSOR notification...

What's the APIs equivalent of setting Screen.MouseIcon?

I've tried:
Code:hCursor = LoadCursorFromFile(path)
SetClassLong Me.hWnd, GCL_HCURSOR, hCursor
On Error Resume Next
Dim c As Control
For Each c in Me.Controls
    SetClassLong c.hWnd, GCL_HCURSOR, hCursor
On Error Goto 0
but it doesn't change the cursor of nonclient area, and cursor looks weird when I move back and fore from client to nonclient area.

I've also tried:
Code:hCursor = LoadCursorFromFile(path)
SetClassLong Me.hWnd, GCL_HCURSOR, ByVal 0
On Error Resume Next
Dim c As Control
For Each c in Me.Controls
    SetClassLong c.hWnd, GCL_HCURSOR, ByVal 0
On Error Goto 0

SetCursor hCursor

but it doesn't help much either...
(using a timer to check foregroundwindow is even worse...)

The reasons why I don't want to use Screen.MouseIcon are:
1) Setting the mouse icon to a cursor file only permits black and white
2) Setting the mouse icon to an icon file does not let me change the hotspot......


Edited by - imessvb on 3/27/2004 10:23:42 AM

Drag & Drop Mouseicon
When doing a drag/drop is it possible to set the dragicon property so the icon used is the same as the OS icon? Currently I'm just using a downloaded icon but I'd like to it to look the same if possible.

Changing Mouseicon Beyond My Application

Is there anyway I can change the mouse icon throughout the system and not just in my application. Screen.mousepointer just works when the mouse is within my application and as soon as the user switches to another application the cursor changes back.



Change Mouseicon On Mshflexgrid Header
I would like to change the mouseicon when passing on mshflexgrid header (only header). Is it possible or it automaticaly apply on all the grid ?. and in the same way, is it also possible to change the 'colheaderforecolor' when passing over ? (which mean manage cols)
Thank for any ideas.

Changing Custom MouseIcon As Runtime
Does anybody know how to change the MouseIcon property of a form during run time.
I'd like to put a custom one but dont know how to ask it.

Form1.MouseIcon = ???

Maybe I should declare a specific variable and assing it the path of my custom icon, but I dont know the correct type.

Avoiding MouseIcon=LoadPicture For All Forms
Instead of using the LoadPicture method on every form I'd like to point to a ImageList object where I have the icon pre-loaded. However, I'm losing it in the syntax. Can someone help me navigate the object hierarchy so I can point from my FormB back to the main form MDIFormA ImageList object (imlMyIcons)?

Setting MouseIcon Of A Picture Box To An Image From The Imagelist
VB Code:
picgrid.MouseIcon = ImageList1.ListImages(1).Picture

The above code returns "Invalid Property". Any other way to do that?

Screen.MouseIcon = Picture1.picture; Doesn't Assign . Any Clues ?
Form with PictureBox Control with small .BMP assigned to Picture1.Picture

screen.mousepointer = 99
screen.mouseicon = Picture1.Picture

Causes a wrong property assignment error
although the VB Help states this syntax.
It only works if Picture1.picture is an .ico file and not a .BMP.

Am I missing something ?

R:- ( ..................................

Disappearing Add-In

I am having a problem with an add-in I have written in that I can't get it to stay permanently loaded in Excel. I have tried installing it using the normal method (Tools - Add Ins menu option) and it appears to load. The menu option created by the add in appears and all the options within it work OK. When I close Excel and re-start it I briefly see the new menu option but it then disappears. By clicking on the Tools - Add ins menu option I see my add in listed with a tick in the check box but the menu option is not there. I have to remove the tick, click OK and then select the menu option again and put the tick back in.

I do not think this is a problem with the add in as I have several other add ins that have started to act in the same way.

I am running XP professional with SP2, Office 2003 with SP1.

Any advice will be greatly appreciated.


Disappearing Box
I'm doing an application where I'm trying to display a "do you want to save your file" box. I'm using a form with 3 buttons, each of which sets a return code that is returned to the calling program. The problem is that the box flashes and disappears without waiting for a button click. What is causing this? Every other form in my project waits for keyboard input, so this is new territory.

Please advise me as to what I have to do to remedy this.


Disappearing Act!
I'm working on a VBA project in Outlook and I need to use a data grid hooked
up to an ado control. I've tried the msh grid, and my custom vsflex grid
both, and when i place them on the form, and check the properties, the
DATASOURCE property is GONE!

I tried connecting thru code, and the data source property shows in the
popup list, but when the code runs, the error message says no such property!

What's happening? How can I get to those obviously important properties?

mark c

Disappearing Act
Here's a strange one for you. I've been messing around with MS Agent and got the genie to work. So I've been unusually proud of actually figuring out something on my own that I've been sending little messages to people. It is just a form with a button to click and the genie appears and says a little nonsense. I put the form to visible = false so it would just have the genie talking. Well the genie comes on, talks, of course the form disappears, then genie goes away. So now is the form really there or is it?

It's an exe file sent e-mail. I don't see it on the desktop but it shows in the desktop folder.
Dim Genie As IAgentCtlCharacterEx
Const DATAPATH = "genie.acs"

Private Sub Form_Load()
    Agent1.Characters.Load "Genie", DATAPATH
    Set Genie = Agent1.Characters("Genie")
    Genie.LanguageID = &H409
End Sub

Private Sub Command1_Click()
    Genie.Speak "Hi Louise how are you doing?..I hope you had a great thanksgiving! " & _
        "I hope your job is going better these days..I don't look like Steve but" & _
        " my name is Steve..Maybe we could see a movie to you soon"
End Sub

You need the Agent component from the project menu and reference MS agent as well.
There are about 4 or 5 files to download to get this critter to work.
core components
genie character


Disappearing Images

I've developed a wizard type application in VB.NET, where users move from one screen to the next by clicking on the Next/Previous buttons. These buttons are actually Pictureboxes, as I wanted to be able to handle the mouseDown, mouseOver etc images myself. This is achieved by allocating different embedded resource images to the image property of the picturebox, on these different events. When first starting the wizard, these picture boxes are hidden, until the user has moved through a couple of initial screens. Once they have moved through these initial screens, the Next/Previous pictureboxes appear, by calling something like NextPictureBox.Show().

My problem is that on one particular persons machine, the Show event does not appear to be successful. The pictureboxes simply do not ever appear. This has never happened on any other machines, and I cannot see that there is anything unusual about this persons machine/setup.

Any clues?

Lines Disappearing
I'm writing a graph program where one form is the actual graph itself and another form contains an area to enter XY Coordinates for the actual graphing and such.

It works fine, it's just that if you move the Coordinates Form over the lines on the Graph form, they'll disappear.

Attached is an example of what I mean...

Disappearing OD Control
It's bound to be a property I'm not setting correctly but for the life of me I can't figure out what it is. The problem occurs when I show a MsgBox in the click event of my control. Say I click on my control at run-time, the message box pops up. I drag the message box across the screen, over the top of my control and the message box acts like an eraser. It wipes my control off the form and it won't be redrawn until I close the message box. What am I doing wrong?

Menu's Disappearing
I'm getting this weird effect where when I go to a menu, like file at the top of my form the commands listed under it are invisible until i put my mouse over the area where the commands are. If I just go to file, the area where the command should be is there and is a color that matches the background color of the form.. commands are invisible till mouse over, any idea how I can fix this?

Disappearing Ampersand
I wrote a simple little pprogram with a menu in the menu editor I placed an & before the word File expecting the F to be underlined and did the same for other menu items. However when the program is run no underlines appear. If I press Alt "F" the menu appears as it should an the underline is present.
Any ideas on this?


Disappearing Tabs
I've created an application that uses an SSTab control with 9 tabs. I've been making enhancements to this application for many months, and all of the new features seem to work fine, but recently have had two people experience the tabs disappear. The application appears to be running normally, but only one tab is displayed and hence you can't get to any of the controls on the other tabs. The form also has the appearance of being shifted down a little bit. Anyone have any idea what might be going on here? I have not been able to duplicate this problem so far.

Thanks for your help!!!

Disappearing Model
Hi folks,

I am making a program but for some reason when i turn on my colission detection on the floor of my level disappears. i don't know whats doing it:

Private Sub GameDetection()
If ColDet(DXE.mesh, Old.x, Old.y, Old.z, test2.x, test2.y, test2.z, 2) = 1 Then
Debug.Print "Geraakt !!!"
test2 = Old
End If
End Sub

coldet :

Private Function ColDet(mesh As D3DXMesh, XStart As Single, YStart As Single, ZStart As Single, XEnd As Single, YEnd As Single, ZEnd As Single, Distance As Single) As Long
Dim Hit As Long
Dim hits As Long

Dim u As Single
Dim v As Single
Dim Dist As Single

Dim XDiff As Single
Dim YDiff As Single
Dim ZDiff As Single
Dim Size As Single

Dim FaceIndex As Long
Dim vecDir As D3DVECTOR

XDiff = XEnd - XStart
YDiff = YEnd - YStart
ZDiff = ZEnd - ZStart

D3DXVec3Normalize vecDir, DXE.MakeVector(XDiff, YDiff, ZDiff)

DXE.D3DX.Intersect mesh, DXE.MakeVector(XStart, YStart, ZStart), vecDir, Hit, FaceIndex, u, v, Dist, hits

If Hit = 1 Then
Size = Sqr(XDiff * XDiff + YDiff * YDiff + ZDiff * ZDiff)
If Dist - 2 > Size Then
Hit = 0
End If
End If
ColDet = Hit
End Function

Disappearing Button??
After unloading a form if I reload it one of my buttons seems to dissapear. It is there and will respond but is completely transparent. Any ideas how to stop this happening? It only occurs if the form is unloaded whilst in the middle of running a sub? Ive enclosed screen dumps to help show the problem. Any help much appreciated!


Disappearing TOOLBAR ????
I have a program that has a couple different forms. When the first form initially loads the toolbar is visible and active with no problems. When the user goes to the second form the toolbar is visible and active with no problems. If they answer YES to a msgbox (vbYesNo) it closes the second form and reloads the first form.

The problem is that when the first form is Re-Loaded the toolbar is there, BUT --- ALL THE BUTTONS are GONE !!!!!

All the code from the second form does is:

Unload frmEntry
Set frmEntry=Nothing
frnStartup.Move 0,0

Does ANYONE have any ideas why the toolbar would be coming up BLANK ???

Any ideas or suggestions would be GREATLY appreciated.


Disappearing Menus

Is there anyway of stopping a menu from disappearing when I click on one of the options. I mearly want to check/uncheck the option.


Text Is Disappearing
I have a VB6 program that works fine on the development machine (Win XP and on several machines that run Win 98, but on some other computers with Win XP or in 2000 - TEXT DISAPPEARS.

Form1 is open and has controls and text. Form2 opens and covers up part of form1. When form2 gets closed, any text on form1 that was covered up by form2 is gone. The controls are still there, and any text that was not covered by form2 is still there. I'm guessing it may have to do with outdated DLL files, but don't know where to start looking.

Thanks for any ideas.

Picture Disappearing
I have a strange problem....

I add pictures to some pictureboxes with this code

Me.picturebox(Index).PaintPicture Me.image(gintBildIndex).picture, 0, 0

The picturebox gets the picture and everything is great until i Minimize the window... and resize it... then the pictureboxes ar empty???
The images has disappeared..???
Why? Where have they gone?

Disappearing Circle

Problem 1.
i have got an image that scrolls. when the user clicks on the image a red circle is drawn. My problem is when the red circles are scrolled off the screen, they are not there when the image is scrolled back

How do i make the circles remain when the image is scrolled.

Problem 2.
the image i am using is too big for the picture box, this is the reason i am using scroll bars. I would like the user to be able to see a mini version of the whole image and in this, an indicator to show which part of the image they are looking at. Can anyone give me an idea how to do this?


Disappearing Text Box
I have a control array of seven text boxes located on an SSTab. Based on information, the 7th text box is either visible or not. However, when it should be visible, it doesn't appear on the form.

I've debugged it, and have discovered that it is indeed visible and invisible when it should be. And if I switch the index of the text box from 6 to 7, it does appear. However, for efficiency's sake, I would like to keep the index in sequential order. Does anyone know what is happening? And, if I have to go to seven, what is the code to check to see if there is actually a text box with that index?


Combobox Disappearing
i have a form that has frames txtboxes buttons and comboboxes.
On click of a button another form popsup over the form.
when the popup form is closed and have gone back to the original form all the
objects are there except the combobox (apart from a tiny little bit that was not covered by the popup form.
When i click on it the whole combobox becomes visible again.

I have looked at autoredraw for the form but this does not solve the prob.

Can anyone help.



Copyright 2005-08, All rights reserved