将轨迹栏插入C#表单工具栏 [英] Insert trackbar into C# forms toolbar
问题描述
十年前,有人问过"如何将轨迹栏插入工具条栏"
Ten years ago, someone asked "How to insert trackbar into toolstrip bar"
来自微软论坛支持团队的叶志新建议插入以下代码,然后说"编译完成后,你会在ToolStrip的下拉列表中找到一个ToolStripTraceBarItem,从下拉列表中选择它,你就可以将一个TraceBar添加到
ToolStrip。"
Zhi-Xin Ye from Microsoft Forum Support Team suggested inserting the below code, and then said "After compiling, you'll find a ToolStripTraceBarItem in the drop down of the ToolStrip, select it from the drop down you'll be able to add a TraceBar to the ToolStrip."
除非没有发生。我编译了下面的内容,VS2012工具栏下拉列表显示了所有常用项目,包括ProgressBar,但没有ToolStripTraceBarItem。
Except that doesn't happen. I've compiled the below, and VS2012 toolbar drop down shows all the usual items, including ProgressBar, but no ToolStripTraceBarItem.
还需要做什么才能使轨迹栏或滑块可用一个C#工具栏?
What else needs to be done to make a trackbar or slider available in a C# toolbar?
[ToolStripItemDesignerAvailability (ToolStripItemDesignerAvailability.ToolStrip | ToolStripItemDesignerAvailability.StatusStrip)]
public class ToolStripTraceBarItem : ToolStripControlHost
{
public ToolStripTraceBarItem() : base(new TrackBar())
{
}
}
推荐答案
In可以在Toolbox的"所有Windows窗体"区域中找到Visual Studio 2017,
TrackBar 。您也可以右键单击打开的工具箱,然后选择"选择项目...",您可以在其中找到并启用
TrackBar 控件。检查是否可以在您的版本中完成此操作。
In Visual Studio 2017, TrackBar can be found in the "All Windows Forms" area of Toolbox. You can also right-click the opened Toolbox, then "Choose Items…", where you can find and enable the TrackBar control. Check if this can be done in your version.
这篇关于将轨迹栏插入C#表单工具栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!