在TOOLBAR上加了几个按钮(有图标的),想在图标按钮下显示字体,但显示不出来,为什么?
解决方案 »
- 一个通用自动更新demo
- 360 刷票机 如何匹对12306的验证码的?
- 逻辑思维太差,求助一个算法,帮帮忙!遵纪守法,立马给分
- FolderBrowserDialog控件可以实现选择文件吗?
- 使用VS2010制作的web安装包安装过程很长
- 在WinForm中点按钮时,出现正在查询,是怎么实现的
- c#能动态继承某一个类吗?
- 高手:ListView 的效果如何处理可以做成Media Player那样子的,点击后,选项可以进入编辑模式?
- 关于自定义用户控件小问题?
- 请问什么时候应该在.net中使用事务,什么时候应该在数据库中使用事务
- 我做的网页在有事件触发(如点击button)时总要回到顶端?怎样解决?谢谢!
- 100分求解决方案
每个按钮的Text是什么?有吗?
using System;
using System.Windows.Forms;namespace ToolbarText
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.ToolBar toolBar1;
private System.Windows.Forms.ImageList imageList1;
private System.Windows.Forms.ToolBarButton toolBarButton1;
private System.Windows.Forms.ToolBarButton toolBarButton2;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.ToolBar toolBar2;
private System.Windows.Forms.ToolBarButton toolBarButton3;
private System.Windows.Forms.ToolBarButton toolBarButton4;
private System.ComponentModel.IContainer components; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: Add any constructor code after InitializeComponent call
//
} /// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
} #region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
this.toolBar1 = new System.Windows.Forms.ToolBar();
this.imageList1 = new System.Windows.Forms.ImageList(this.components);
this.toolBarButton1 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton2 = new System.Windows.Forms.ToolBarButton();
this.panel1 = new System.Windows.Forms.Panel();
this.toolBar2 = new System.Windows.Forms.ToolBar();
this.toolBarButton3 = new System.Windows.Forms.ToolBarButton();
this.toolBarButton4 = new System.Windows.Forms.ToolBarButton();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// toolBar1
//
this.toolBar1.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton1,
this.toolBarButton2});
this.toolBar1.DropDownArrows = true;
this.toolBar1.ImageList = this.imageList1;
this.toolBar1.Location = new System.Drawing.Point(0, 0);
this.toolBar1.Name = "toolBar1";
this.toolBar1.ShowToolTips = true;
this.toolBar1.Size = new System.Drawing.Size(576, 41);
this.toolBar1.TabIndex = 0;
//
// imageList1
//
this.imageList1.ImageSize = new System.Drawing.Size(16, 16);
this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream")));
this.imageList1.TransparentColor = System.Drawing.Color.Transparent;
//
// toolBarButton1
//
this.toolBarButton1.ImageIndex = 1;
this.toolBarButton1.Text = "邮件";
//
// toolBarButton2
//
this.toolBarButton2.ImageIndex = 0;
this.toolBarButton2.Text = "删除";
//
// panel1
//
this.panel1.BackColor = System.Drawing.Color.Ivory;
this.panel1.Controls.Add(this.toolBar2);
this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
this.panel1.Location = new System.Drawing.Point(0, 41);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(576, 47);
this.panel1.TabIndex = 1;
//
// toolBar2
//
this.toolBar2.Appearance = System.Windows.Forms.ToolBarAppearance.Flat;
this.toolBar2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.toolBar2.Buttons.AddRange(new System.Windows.Forms.ToolBarButton[] {
this.toolBarButton3,
this.toolBarButton4});
this.toolBar2.DropDownArrows = true;
this.toolBar2.ImageList = this.imageList1;
this.toolBar2.Location = new System.Drawing.Point(0, 0);
this.toolBar2.Name = "toolBar2";
this.toolBar2.ShowToolTips = true;
this.toolBar2.Size = new System.Drawing.Size(576, 42);
this.toolBar2.TabIndex = 0;
//
// toolBarButton3
//
this.toolBarButton3.ImageIndex = 1;
this.toolBarButton3.Text = "邮件";
//
// toolBarButton4
//
this.toolBarButton4.ImageIndex = 0;
this.toolBarButton4.Text = "删除";
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(576, 294);
this.Controls.Add(this.panel1);
this.Controls.Add(this.toolBar1);
this.Name = "Form1";
this.Text = "Form1";
this.panel1.ResumeLayout(false);
this.ResumeLayout(false); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
}
}
只需要改动一下namespace。