C# Visual Studio 2005中修改toolStrip的内容
来源:互联网 发布:北风网大数据视频下载 编辑:程序博客网 时间:2024/06/11 09:07
今天修改一个C#程序的debug。其中有一个debug,我在我的程序里添加了一个toolStrip,然后在其上面添加了几个按钮,如toolStripButton1、toolStripButton2、toolStripButton3等多个按钮,然后我用编程的方式改变它的ToolTipStrip代码如下:
toolStripButton1.ToolTipText = "New File";
但是很遗憾没有修改过来,程序运行以后它的ToolTip仍然为toolStripButton1,没有修改过来。我抓破头皮想了很多办法,查了MSDN,MSDN如是说:
ShowItemToolTips 设置为 true 时,ToolTipText 才有效。如果 AutoToolTip 设置为 true,则该项的 Text 属性将用作 ToolTipText。
只有当
internal ToolStripButton imageButton;private void InitializeImageButtonWithToolTip(){ // Construct the button and set the image-related properties. imageButton = new ToolStripButton(); imageButton.Image = new Bitmap(typeof(Timer), "Timer.bmp"); imageButton.ImageScaling = ToolStripItemImageScaling.SizeToFit; // Set the background color of the image to be transparent. imageButton.ImageTransparentColor = Color.FromArgb(0, 255, 0); // Show ToolTip text, set custom ToolTip text, and turn // off the automatic ToolTips. toolStrip1.ShowItemToolTips = true; imageButton.ToolTipText = "Click for the current time"; imageButton.AutoToolTip = false; // Add the button to the ToolStrip. toolStrip1.Items.Add(imageButton);}
但是非常遗憾,问题依然从在。
于是猛的想起还可以在toopStripButton的属性框中修改。哈哈,这一修改竟然成功了。
也有个比较遗憾的问题是我不知道为什么象我用编程的方式那样写还是不行,如果你知道,请给我留言。
- C# Visual Studio 2005中修改toolStrip的内容
- C#中去掉Toolstrip边框的方法
- C#中去掉Toolstrip边框的方法
- C#中去掉Toolstrip边框的方法
- C# Visual Studio 2005中将一个TextBox中的内容通过FileStream写到文件中
- toolStrip 按钮图片大小的修改
- C#中改变工具条ToolStrip的位置/宽度/高度?
- C# Visual Studio 2005中隐藏窗体
- C# Visual Studio 2005中添加帮助文件
- C# Visual Studio 2005中添加打印
- Visual Studio C# 修改后的程序发布
- 还是c#的toolstrip简单
- Visual Studio Code修改HTML Snippets插件中默认模板内容
- 修改Visual Studio的界面风格
- Android studio 修改文件中 created by 后面的内容
- Visual Studio 2010中关于C#的几点改进
- Visual Studio 2010——C#中函数的参数
- C# ToolStrip 控件的动态生成
- 基于JDBC的数据库连接池技术研究与应用
- 运用Jakarta Struts的七大实战心法解析
- 精典的SQL语句,推荐收藏
- Hibernate 深入研究之 Criteria
- [SQLServer:Export Data]SQL Server之间如何导出数据
- C# Visual Studio 2005中修改toolStrip的内容
- [SQLServer:Profiler]跟踪指定的SQL执行
- 在ASP.NET,如何实现按拼音检查的下拉框?
- AMT实习首日,体验颇多,感觉不错,Great!在AMT每天的工作和学习日志,今天开始都将记录在此,oyeah~
- 从今天起争取每天更新BLOG!关于AMT实习经历,完全同步于blog.vsharing.com/flyshufeman
- [SQLServer:查询分析器]使用模板(Insert,Update,Select,SP)
- 心烦!!!
- 计算机科学类优秀书籍推荐 Mathematics (数学)& Data Structures & Algorithms (数据结构、算法) &Database (数据库)
- 书籍blog