NET开发中的一些小技巧
2006-11-20 12:53
330 查看
这篇文章来自是Mukund Pujari的《Some Cool Tips for .NET》。
1. 如何创建一个可改变大小没有标题栏的窗体?(How to create a form with resizing borders and no title bar?)
form1.Text = string. Empty;
form1.ControlBox = false;
2. 如何在.NET的Windows窗体上启用XP主题集?(How to use XP Themes with Windows Forms using the .NET?)
确认你的控件中FlatStyle属性已经修改为System,再修改Main方法。
static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application. Run(new Form1());
}
3. 如何为一个窗体设置一个默认按钮?(How to set the default button for a form?)
form1.AcceptButton = button1;
4. 如何为一个窗体设置一个取消按钮?(How to set the Cancel button for a form?)
form1.CancelButton = button1;
5. 如何阻止一个窗体标题显示在任务栏上?(How to prevent a form from being shown in the taskbar?)
设置窗体的ShowIntaskbar属性为False
6. 如何用现有可用字体绑定到ComboBox控件?(How to fill a ComboBox with the available fonts?)
comboBox1.Items.AddRange (FontFamily.Families);
7. 如何禁止TextBox控件默认的邮件菜单?(How to disable the default ContextMenu of a TextBox?)
textBox1.
1. 如何创建一个可改变大小没有标题栏的窗体?(How to create a form with resizing borders and no title bar?)
form1.Text = string. Empty;
form1.ControlBox = false;
2. 如何在.NET的Windows窗体上启用XP主题集?(How to use XP Themes with Windows Forms using the .NET?)
确认你的控件中FlatStyle属性已经修改为System,再修改Main方法。
static void Main()
{
Application.EnableVisualStyles();
Application.DoEvents();
Application. Run(new Form1());
}
3. 如何为一个窗体设置一个默认按钮?(How to set the default button for a form?)
form1.AcceptButton = button1;
4. 如何为一个窗体设置一个取消按钮?(How to set the Cancel button for a form?)
form1.CancelButton = button1;
5. 如何阻止一个窗体标题显示在任务栏上?(How to prevent a form from being shown in the taskbar?)
设置窗体的ShowIntaskbar属性为False
6. 如何用现有可用字体绑定到ComboBox控件?(How to fill a ComboBox with the available fonts?)
comboBox1.Items.AddRange (FontFamily.Families);
7. 如何禁止TextBox控件默认的邮件菜单?(How to disable the default ContextMenu of a TextBox?)
textBox1.
相关文章推荐
- ASP.NET开发一些小技巧
- Asp.net &C#开发中的一些注意事项及小技巧
- NET开发中的一些小技巧
- NET开发中的一些小技巧
- NET开发中的一些小技巧
- .NET开发中的一些小技巧
- NET开发中的一些小技巧
- Asp.net &C#开发中的一些注意事项及小技巧
- Asp.net &C#开发中的一些注意事项及小技巧【转】
- NET开发中的一些小技巧
- NET开发中的一些小技巧
- asp.Net开发中的一些小技巧
- NET开发中的一些小技巧
- C#中??和?分别是什么意思? 在ASP.NET开发中一些单词的标准缩写 C#SESSION丢失问题的解决办法 在C#中INTERFACE与ABSTRACT CLASS的区别 SQL命令语句小技巧 JQUERY判断CHECKBOX是否选中三种方法 JS中!=、==、!==、===的用法和区别 在对象比较中,对象相等和对象一致分别指的是什么?
- 最近ASP.NET WAP开发的一些情况!
- asp.net mvc开发过程中的一些小细节
- 一些Asp.net的小技巧
- asp.net开发与web标准的冲突问题的一些常见解决方法
- asp.net开发的一些问题