Change ToolStripDropDownButton Text by Selecting Item
c#, winforms
Solution
I have found the answer to my question, thank you all for the answers.
private void changeGridSizeDropDownButton_DropDownItemClicked(object sender, ToolStripItemClickedEventArgs e)
{
if (e.ClickedItem != null)
{
changeGridSizeDropDownButton.Text = e.ClickedItem.Text;
// This line converts my list gridsize options like 64, 32, and 16
// and Parses that text into the new selected gridsize.
gridSize = Int32.Parse(e.ClickedItem.Text);
}
}
Problem
I have been stuck on this problem for awhile now, and I was hoping for some direction or an answer. How do you change the text of a ToolStripDropDownButton based off of a selected item within itself? I have a grid that is to be displayed, but I want to change the size of the grid on the fly. By selecting the ToolStripDropDownButton and selecting a predetermined list of grid sizes, the text of the ToolStripDropDownButton should change to show the user the new grid size. Any answer is appreciated.