Skip to content

Instantly share code, notes, and snippets.

@Willy-Kimura
Last active November 7, 2017 06:18
Show Gist options
  • Save Willy-Kimura/4b7bb51f56fca8ce0853ce49df03fb4d to your computer and use it in GitHub Desktop.
Save Willy-Kimura/4b7bb51f56fca8ce0853ce49df03fb4d to your computer and use it in GitHub Desktop.
This moves the separator (indicator) to reflect the position of the clicked label.
public void MoveIndicator(object sender)
{
// Convert the object clicked to a label for easier access to its properties.
Bunifu.Framework.UI.BunifuCustomLabel clicked_label = (Bunifu.Framework.UI.BunifuCustomLabel)sender;
// Set the location of the separator (horizontally) to be below the clicked label.
BunifuSeparator.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.
BunifuSeparator.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);
}
private void BunifuCustomLabel1_Click(object sender, EventArgs e)
{
// Call the method and use the "sender" parameter here as the object clicked.
MoveIndicator(sender);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment