Okay, I'll have a go with this. I will need to wrap this in to a custom control to keep the source code of FMain ungluttered. Let's leave out the label for now to make things more simple. So far I have created a "NiceButton.class":
' Gambas class file
Inherits Panel
Public Sub _New()
Me.Background = Color.Black
End
Private Sub Me_MouseDown()
Me.Background = Color.Red
End
Private Sub Me_Enter()
Me.Background = Color.Yellow
End
Private Sub Me_Leave()
Me.Background = Color.Black
End
Private Sub Me_MouseUp()
Me.Background = Color.Black
End
Private Sub Me_GotFocus()
Me.Border = Border.Dashed
End
Private Sub Me_LostFocus()
Me.Border = Border.None
End
I have this in a new Graphical application with a single VBox on the FMain to populate my buttons (or a single button now for starters):
Public Sub Form_Open()
PopulateGUI()
End
Private Button_Refresh As NiceButton
Private Sub PopulateGUI()
With Button_Refresh = New NiceButton(VBox1) As "Button_Refresh"
.Height = 28
.Width = 120
End With
End
Public Procedure Button_Refresh_Click()
Me.Text = "It works!"
End
Only hovering the mouse cursor over my nice panel button or clicking it has no effect What am I doing wrong here?