.NET开发中的一些小技巧
来源:互联网 发布:windows 的平板推荐 编辑:程序博客网 时间:2024/05/16 06:38
form1.ControlBox = false;
2. 如何在.NET的Windows窗体上启用XP主题集?(How to use XP Themes with Windows Forms using the .NET?)
{
Application.EnableVisualStyles();
Application.DoEvents();
Application. Run(new Form1());
}
3. 如何为一个窗体设置一个默认按钮?(How to set the default button for a form?)
MessageBox.Show(Environment.GetFolderPath( Environment.SpecialFolder.Personal ));
MessageBox.Show(os.Version.ToString());
MessageBox.Show(os.Platform.ToString());
dateTimePicker1.Format = DateTimePickerFormat.Custom;
{
if( obj.GetType()== typeof(System.Windows.Forms.StatusBar))
{
StatusBar sBar=(StatusBar)obj;
sBar.Visible=false;
}
}
15. 如何利用Crystal Report程序来生成PDF版本?(How to generate PDF version of Crystal Report programmatically?)
ExportOptions exportOpts = new ExportOptions();
PdfRtfWordFormatOptions pdfFormatOpts = new PdfRtfWordFormatOptions ();
DiskFileDestinationOptions diskOpts = new DiskFileDestinationOptions();
exportOpts = O_Report.ExportOptions;
// 设置PDF格式
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.FormatOptions = pdfFormatOpts;
// 设置文件选项和导出
exportOpts.ExportDestinationType = ExportDestinationType.DiskFile;
diskOpts.DiskFileName = "C://Trial.pdf"; //设置PDF导出路径
exportOpts.DestinationOptions = diskOpts;
O_Report.Export ();
16.通过代码如何输入多行文本?(How to enter multiline text in textbox through code? )
string [] strAddress = {"Mukund Pujari","Global Transformation Technologies","Pune, India"};
textBox1.MultiLine=true;
textBox1.Lines=strAddress;
textBox1.Text="Line 1/r/nLine2/r/nLine3.";
用"System.Environment.NewLine"来替代换行符号
ts1.MappingName = "Items"; //分配要应用样式的Data Table
DataGridColumnStyle boolCol = new DataGridBoolColumn(); // 创建CheckBox列
boolCol.MappingName = "ch"; //分配数据列名称
boolCol.AllowNull=false; // 修改AllowNull属性
comboBox1.DataSource = dataset.Tables[ "Items" ];
comboBox1.ValueMember = "CustomerID";
comboBox1.DisplayMember = "CustomerID";
listBox1.DataSource = dataset.Tables[ "Items" ];
listBox1.ValueMember = "CustomerID";
listBox1.DisplayMember = "CustomerID";
双击打开,熟悉吧
按照向导创建完成一个数据库链接,测试成功
确定后,链接字符串写入这个文件,用记事本打开就看到了
A href="mailto:email@address1.com,email@address2.com?cc=email@address3.com&Subject=Hello&body=HappyNew Year"
引用System.Diagnostics.Process 命名空间
Process process = new Process();
process.StartInfo.FileName = "mailto:email@address1.com,email@address2.com?subject=Hello&cc=email@address3.com
&bcc=email@address4.com&body=Happy New Year" ;
process.Start();
panel1.BackColor = Color.FromArgb(65, 204, 212, 230);
注意:在设计时手动输入这些值,不要用颜色选取
25. 如何触发Button的Click事件?(How to trigger a button click event? )
http://bbs.csai.cn/bbs/view.asp?Id={7BD6E2EF-98E8-4367-8AE6-0A31904F50C2
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- NET开发中的一些小技巧
- .NET开发中的一些小技巧
- NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- .NET开发中的一些小技巧
- 子字符串查找算法
- windows 批处理修改文件名
- 弹窗代码以及弹不出来的原因分析
- C#释放未托管的资源
- 软件开发主要文档编写规范
- .NET开发中的一些小技巧
- antlr指南(前言)
- 堆和栈的区别(转过无数次的文章)
- C/C++头文件一览
- SMGP协议之Submit
- 项目中的一些小东西(慢慢补充)
- lucene 分组统计查询
- VS2005(c#)项目调试问题解决方案集锦
- C++著名程序库的比较和学习经验