Pages

Saturday, April 21, 2012

Display Image on Mouse Over on Command Button in Access Form

If you want to display image on mouse over on "Command Button "  in access form.


Step 1 . Open the form in design mode


Step 2.  Add a label to it and keep the caption blank( Note Label size should be  bigger than Command button and command button should be added/moved on label . Snapshot below)


Step 3 Add a command button above the label and image which you want to display.

Check the snapshot below in design mode-



Add below code to form on which you have added all the label.button and image.



Option Compare Database

Private Sub Command0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Image1.Visible = True Then Exit Sub
Image1.Visible = True
End Sub



Private Sub Form_Load()
Image1.Visible = False
End Sub
Private Sub Label4_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Visible = False
End Sub





1 comment:

  1. In excel

    http://www.excelvbamacros.com/2012/03/display-image-on-mouseover.html

    ReplyDelete