1
我有一个窗体上的工具条的控制和编程方式使用下面的代码如何在C#中获取所选toolstripbutton指数
toolStrip1.Visible = true;
ToolStripItem t = new ToolStripButton();
t.Text = client.EndPoint.ToString();
t.TextImageRelation = TextImageRelation.ImageAboveText;
t.BackgroundImage = Image.FromFile("" + Application.StartupPath + "ps1_new.PNG");
t.AutoSize = false;
t.Height = 67;
t.Width = 70;
t.BackgroundImageLayout = ImageLayout.Stretch;
t.TextAlign = ContentAlignment.BottomCenter;
toolStrip1.Items.Add(t);
现在即时通讯试图让工具条的索引按钮添加到工具条控制按钮,当我点击它 注意到我能得到的点击文本toolstripbutton使用
e.ClickedItem.Text;