MouseOver Event?

Post your Gambas programming questions here.
Post Reply
01McAc
Posts: 66
Joined: Sunday 24th January 2021 8:25pm

MouseOver Event?

Post by 01McAc » Monday 29th March 2021 3:36pm

For my ongoing little project "A Personal Lens Register" I am desperately looking for a MouseOver sort-of-event. But first things first.
The form where the lens rating is shown (attached) has 10 criteria to rate a lens. My use case is just that simple: whenever I hovering the mouse over one of the 10 panels (e.g. Landscape, Lens Focal Throw, Vignetting, etc) a help text should appear on the right hand side. Any ideas how to show up a help text without clicking to any objects?
Rating.jpg
Rating.jpg (155.04 KiB) Viewed 276 times

User avatar
cogier
Site Admin
Posts: 691
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: MouseOver Event?

Post by cogier » Monday 29th March 2021 4:40pm

Run this code in a "Graphical application". I think this is what you are looking for.
TextLabel1 As TextLabel
HBox1 As HBox
Label1 As Label

Public Sub Form_Open()

  With Me
    .h = 200
    .w = 700
    .Padding = 5
    .Arrangement = Arrange.Vertical
  End With

  With TextLabel1 = New TextLabel(Me) As "TextLabel1"
    .Expand = True
    .Alignment = Align.Center
  End With

  With HBox1 = New HBox(Me)
    .H = 28
  End With

  With Label1 = New Label(HBox1) As "Label1"
    .H = 28
    .Expand = True
    .Alignment = Align.Center
    .background = Color.Yellow
    .Font.Bold = True
    .Text = "Hover over me!"
  End With

End

Public Sub Label1_Enter()

  TextLabel1.Font = Font["55,bold"]
  TextLabel1.Text = "Hello 01McAc!"

End

Public Sub Label1_Leave()

  TextLabel1.Text = ""

End

01McAc
Posts: 66
Joined: Sunday 24th January 2021 8:25pm

Re: MouseOver Event?

Post by 01McAc » Monday 29th March 2021 4:55pm

cogier wrote:
Monday 29th March 2021 4:40pm
I think this is what you are looking for.
Indeed, this is it.
And it's the Enter-event! I am still blinded by Access.
Thank you.

Post Reply