C # study notes

xiaoxiao2021-03-06  61

First, interact between the data between Windows forms in .NET). There are two types, value types, and reference types that use parameters. The value type is inherited from valueetype, and the value of ValueType is inherited from Object; -> Automatically assigns storage space when defined. The reference type is to directly inherit the object type. -> Define the pointer and needs to explicitly allocate storage. two). Add an attribute or method 1 to the form. Use the Owner attribute 2 of the Form class. Use custom properties or methods 3). Use static classes to load your application's configuration file into a static class, let all forms and other instances can be accessed by static properties and static methods.

Second, the main function is non-static member, also known as instance members, must act as an example. When the program is just starting, no instance is established, so instance members cannot be called, including non-static MAIN methods. In order to be able to execute the main method in the start of the program, it must be declared as static. Members called in the main method must also be static unless the corresponding example is established.

Third, .NET GC mechanism If a memory block has an entry in the stack, then .NET is considered to be available, GC will not recover it; and if there is no entry in the stack, then GC will reclaim it. As for a memory block in the current stack, it is related to the location of your New. In general, in the new life domain, it will not be recycled. If the living area ends, the memory block is possible. Recycled and merged.

Fourth, Form Form Layout When Form's control changes to change with Form size, it can be achieved by setting the resize event encoding, which is set by setting the anchor property, defining which of the four sides is fixed to the Form edge fixed design. You can see the effects left: 1 = left fixed, 0 = Move TOP: 1 = Fixed Right: 1 = Right stretch, 0 = fixed bottom: 1 = down-pull

5. Regular expression Use the regular expression to verify the validity of the user input data

Six, the layer of the designer is placed in the top, the order of the underlying is different.

转载请注明原文地址:https://www.9cbs.com/read-117266.html

New Post(0)