Skip to content

Instantly share code, notes, and snippets.

@Willy-Kimura
Created December 8, 2017 12:44
Show Gist options
  • Save Willy-Kimura/0f94b3bec4e0a25ecee9ef75f2387bb6 to your computer and use it in GitHub Desktop.
Save Willy-Kimura/0f94b3bec4e0a25ecee9ef75f2387bb6 to your computer and use it in GitHub Desktop.
This moves our "Tabs" indicator to the position of the control clicked.
Private Sub BunifuCustomLabels_Click(sender As Object, e As EventArgs) Handles BunifuCustomLabel12.Click, BunifuCustomLabel11.Click
' This will firstly off reset the colors of the two Tab labels to the default inactive color.
BunifuCustomLabel11.ForeColor = Color.FromArgb(136, 144, 157)
BunifuCustomLabel12.ForeColor = Color.FromArgb(136, 144, 157)
' This will then set the location of the Tab indicator based on the currently clicked BunifuCustomLabel location (X coordinate).
tab_indicator.Location = New Point(CType(sender, Bunifu.Framework.UI.BunifuCustomLabel).Location.X, tab_indicator.Location.Y)
' Thereafter, we can set the width of the tab inidicator to fit the width of the BunifuCustomLabel clicked. (This is however optional)
tab_indicator.Width = CType(sender, Bunifu.Framework.UI.BunifuCustomLabel).Width + 3
' We can then finally change the color of the BunifuCustomLabel clicked to Black to indicate that's it's currently on focus.
CType(sender, Bunifu.Framework.UI.BunifuCustomLabel).ForeColor = Color.Black
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment