Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Screen.Mousepointer = ? 1

Status
Not open for further replies.

TudorSmith

Programmer
Jan 14, 2002
245
GB
Hi Folks,

I'm in Access 2000 and I'm trying to get the mouse pointer to change to the hand when it hovers over a label on my form.

I've tried:

Screen.Mousepointer = 1 through 20

None of these offer the "Hand" pointer.

Anyone got any ideas?


birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Don't know if this will help...

The hand icon is not available as one of the intrinsic constants.

You can set the pointer to any icon you like using.

'Set mouse pointer to custom
Me.MousePointer = 99

'load image to use
Me.MouseIcon = LoadPicture(&quot;c:\Program Files\html-helper\Icon studio\icons\arrows\ARW02RT.ICO&quot;)

This works in VB6 and should work in ACC2000




There are two ways to write error-free programs; only the third one works.
 
That's not doing it! Any other suggestions? :)

birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
Is it giving and error, or just having no effect??


There are two ways to write error-free programs; only the third one works.
 
Well the first error was that the file being called in LoadPicture() wasn't on my HDD...I substituted the file you stated with any old icon I found on my HDD. Still I was then getting the error &quot;Method or data member not found&quot; and the cursor highlighted the .MouseIcon

Do you think I need to set up a reference?

birklea ~©¿©~ <><
I know what I know...don't presume that I know what I don't! Smithism!!!
 
I think you may be (as you quite rightly say) missing a reference.
I'm just looking to see what you will need to reference....



There are two ways to write error-free programs; only the third one works.
 
I only have four references highlighted:

• Visual Basic For Applications
• Microsoft Access 9.0 Object Library
• OLE Automation
• Microsoft ActiveX Data Objects 2.1 Library


birklea ~©¿©~ <><
Dim objJedi as Jedi.Knight
Set objJedi[skyWalker].Aniken = FatherOf(useThe.Force(objJedi[skyWalker].luke))
 
Found out that the MouseIcon is not available in 2000. This does work though...

'Put this in module
Public Const IDC_HAND = 32649&
Public Const IDC_ARROW = 32512&

Public Declare Function LoadCursor Lib &quot;user32&quot; Alias &quot;LoadCursorA&quot; (ByVal hInstance As Long, ByVal lpCursorName As Long) As Long
Public Declare Function SetCursor Lib &quot;user32&quot; (ByVal hCursor As Long) As Long

Public Declare Function ShellExecute Lib &quot;shell32.dll&quot; Alias &quot;ShellExecuteA&quot; (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long


'for each control you want to have the hand icon for
'put the following in the MouseMove event

Dim hCur As Long

hCur = LoadCursor(0, IDC_HAND)
If (hCur > 0) Then
SetCursor hCur
End If

(fingers crossed!)



There are two ways to write error-free programs; only the third one works.
 
Absolutely fantastic!!! Thanks for the hard work! Have a Star!!!!


Tudor

birklea ~©¿©~ <><
Dim objJedi as Jedi.Knight
Set objJedi[skyWalker].Aniken = FatherOf(useThe.Force(objJedi[skyWalker].luke))
 
Cheers, knew we'd get there in the end...

[bigsmile]

There are two ways to write error-free programs; only the third one works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top