Skip to content

Instantly share code, notes, and snippets.

@Willy-Kimura
Last active November 7, 2017 11:45
Show Gist options
  • Save Willy-Kimura/5b7f0d9778d1010a784b8c7295feb749 to your computer and use it in GitHub Desktop.
Save Willy-Kimura/5b7f0d9778d1010a784b8c7295feb749 to your computer and use it in GitHub Desktop.
This moves the separator (indicator) to reflect the position of the clicked label.
Sub MoveIndicator(ByVal sender As Object)
' Convert the object clicked to a label for easier access to its properties.
Dim clicked_label As Bunifu.Framework.UI.BunifuCustomLabel = CType(sender, Bunifu.Framework.UI.BunifuCustomLabel)
' Set the location of the separator (horizontally) to be below the clicked label.
BunifuSeparator1.Location = New Point(clicked_label.Location.X, BunifuSeparator4.Location.Y)
' Set the width of the separator to be equal to the clicked label's width.
BunifuSeparator1.Width = clicked_label.Width
' Set the fore color of the clicked label to be equal to the separator's color.
clicked_label.ForeColor = Color.FromArgb(132, 171, 204)
End Sub
Private Sub BunifuCustomLabel1_Click(sender As Object, e As EventArgs) Handles BunifuCustomLabel1.Click
' Call the method and use the "sender" parameter here as the object clicked.
MoveIndicator(sender)
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment