如何动态设置标签鼠标图标

时间:2014-12-01 15:28:37

标签: vba ms-word

我在表单中创建动态标签,并希望光标将其样式从标准样式更改为指针。此时代码看起来像这样:

 Set lbl = Me.Controls.Add("Forms.Label.1")
 With lbl
     .Caption = myArray(i) ' array of label names
     .Top = i * 25
     '.MouseIcon = "C:\hand.cur" <- this does not work
 End With

不幸的是,这不起作用。

1 个答案:

答案 0 :(得分:2)

你需要:

    ...
    .MousePointer = fmMousePointerCustom
    .MouseIcon = LoadPicture("C:\hand.cur")
End With