Some Cool Tips for .NET

  今天在codeproject上看到了一篇文章,分享一下: http://www.codeproject.com/useritems/tips.asp,如果有人看了这些问题,希望大家好好看看,一定会收获的。

Introduction

These are some tips for commonly faced problems in .NET . Some of these tips are mine and some of these i have got from different sources. My aim is not to claim the ownership of these tips,but as a newcomer I had faced these problems and had to do lot of googling. So just to help my fellow programmers I am putting this together. One more reason is Codeproject.com ranks quiet ahead s compared to other sites of same nature, but still I was not able to find some basic solutions as below. So it is small effort from my side.

Windows Application

.NET Framework

1. How to get the path for "My Documents" and other system folders?
2. How to get the path to my running EXE?
3. How to determine which operating system is running?
4. How to get a file's name from the complete path string?
5. How to get a file's extension from the complete path string?
6. What is difference beween VB.NET and C#.NET?
7. How to find whether your system has mouse or the number of buttons, whether it has wheel, or whether the mouse buttons are swapped or size of your monitor and many such information?
8. What is the purpose of the [STA Thread] attribute for the Main method of a C# program?
9. How to import CSV data using .NET application?
10. How to find size of logical drives using .NET?
11. How can I get the index of substring in a sentence irrespective of it's case?

OOPS

1. What are Copy Constructors?
2. What are Read-Only Constants?

VS.NET IDE

1. How to manage code snippets in VS.NET IDE?
2. How to display Line Numbers in code editor?
3. How to change the color of the regions?

Controls

Forms

1. How to create a form with resizing borders and no title bar?
2. How to use XP Themes with Windows Forms using the .NET?
3. How to prevent a form from being shown in the taskbar?
4. How to open default E-mail client on your system with all parameters entered in it,like Outlook Express or Eudora, from your .NET windows or Web Application?
5. How to create Pop-Up Alert windows like messengers?
6. What is difference between Anchoring and Docking?

Buttons

1. How to set the default button for a form?
2. How to set the Cancel button for a form?
3. How to trigger a button click event?

Combo Box

1. How to fill a ComboBox with the available fonts?

Text Box

1. How to disable the default ContextMenu of a TextBox?
2. How to enter multiline text in textbox through code?
3. Some useful TextBox Validations
4. How to unselect the text in textbox after it receives focus?

DateTime Picker

1. How to make the DateTimePicker show empty text if no date is selected?

Data Grid

1. How to remove the indeterminate status of checkbox in datagrid?
2. How to group columns in DataGrid?

Panel

1. How to make a Panel or Label semi-transparent on a Windows Form?

WebBrowser Control

1. How to print the contents of Web Browser control?
2. How to assign custom Header and Footer and other page settings while printing the contents of Web Browser control?

ADO.NET

1. How to bind two controls to the same DataTable without having changes in one control also change the other control?

Crystal Reports

1. How to hide the status bar of Crystal Report in Report Viewer?
2. How to generate PDF version of Crystal Report programmatically?
3. How to select a printer while printing through Crystal Report programmatically?

Deployment

1. How to install database while deploying .NET application ?
2. How to install MSDE while deploying .NET application?
3. How to create conditional shortcuts while deploying .NET application?

Add ins

1. How to get a reference to usercontrol in CreateToolWindow2()?

Miscellaneous

1. How to enable the mnemonics (underline) being displayed when an application is launched
2. An easy way to build connection string.
3. How to add a custom or destination folder to SendTo menu?

你可能感兴趣的:(.net)