Skip to content

Instantly share code, notes, and snippets.

@Willy-Kimura
Created December 8, 2017 12:54
Show Gist options
  • Save Willy-Kimura/8ff6b02e231a647de64e22be145f62ab to your computer and use it in GitHub Desktop.
Save Willy-Kimura/8ff6b02e231a647de64e22be145f62ab to your computer and use it in GitHub Desktop.
This moves our "Tabs" indicator to the position of the control clicked.
private void TabsClicked(Object sender, EventArgs e) {
// This will firstly off reset the colors of the two Tab labels to the default inactive color.
BunifuCustomLabel1.ForeColor = Color.FromArgb(136, 144, 157);
BunifuCustomLabel2.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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment