To create a control, inherit from usercontrol, control, or other classes provided by window form.
Usercontrol is suitable for combining controls. Control needs to implement the control's own appearance and so on, but the flexibility is high. Of
1. Read-Only field: the value of a variable should not be changed. Its value is unknown before running.
The readonly keyword that allows a field to be set as a constant. You can perform some operations to determine its initial value. The rule is:
1. string is a reference type, but it differs from the reference type in common operations:
If you modify one of the strings, A New String object is created, and the other string is not changed.
Using system;
Namespace consoleapplication2
{
Public String someproperty
{
// Get accessors do not contain parameters and must return the type of attribute Declaration
Get
{
Return "this is the property value ";
}
// The set accessors do not contain any display parameters, but the compiler
Event: an event is a message sent by an object, which notifies the customer of an operation. This operation may be caused by a mouse click or triggered by some other program logic. The sender of an event does not need to know which object or method
Array class implements the Bubble Sorting of elements in the array. The sort () method requires the implementation of the icomparable interface by elements in the array.
System. String and system. int32 implement the icomparable interface, so you
Use the tag attribute placement encoding of treenode and the text attribute placement name of treenode. The simplest example is as follows: add two nodes first and then process the afterselect event:
Using system;
Using system. drawing;
Using system.
Significance of A = new B ()Premise: A is the parent class of B.A A = new B ();OrA;B = new B ();A = B;
The process of this sentence is as follows,1) create a reference for Class.2) create an instance of Class B3) assign a reference to Class B to
C ++ and C # compile and call COM components
Author: Xu lingchaoDownload source codeAbstract: COM components are more and more widely used. I think everyone has
# Region (C # reference)
# Region allows you to specify a code block that can be expanded or collapsed when you use the outline display function of the Visual Studio code editor. For example:
# Region myclass DefinitionPublic class myclass{Static
Insert data records:The idea is the same as that of the previous two operations, that is, the data records are first inserted to the database through ADO. net, and then necessary modifications are made to the "dataset" object. The
It's about how C # is considerate to programmers, not. NET Framework.
This is a little effort of C # In finalizer:
Public class myclass{Public myclass (){}~ Myclass (){// Your destructor code goes here}}
The above code is equivalent to the
When I was writing code today, I suddenly encountered a problem, that is, type conversion. C # provides mandatory conversions and as conversions.
The problem is that, when an object type is determined, whether the type conversion is forced or as
Static data member usage of anonymous methods
The anonymous method always starts with a delegate keyword, followed by parameters used in the method and the method body. As shown in the preceding example, you do not need to determine the return type
1 /**//*
A custom event of 2 * C #
3 */
4 using system;
5 namespace defaultnamespace
6 {
7 class delegateclass
8 {
9 Public Delegate bool comparator (INT one, int two); // declare the proxy
10 public event comparator oncomparator; // defines an
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service