Virtual function: declares a base-class function as virtual, and the summary function can be rewritten in any derived class.Class mybaseclass{Public Virtual string virtualmethod (){Return "this method is virtual and defined in mybaseclass ";}}You
C # How to obtain the coordinates of the mouse over the current window
You can use control. mouseposition to obtain the coordinates of the current mouse, and use pointtoclient to calculate the coordinates of the mouse relative to a control, as
When a thread is used, if the thread needs to operate the control, add this sentence during form initialization: system. windows. forms. control. checkforillegalcrossthreadcils = false; Detailed descriptions are provided on msdn. In addition,
// Convert the number two, eight, ten, and hexadecimal to a string
Convert.Tostring (number to be converted, in hexadecimal format );
Example:StringStrresult; strresult =Convert. Tostring (253, 2 );// Result: strresult = 11111101Strresult
1. Create a C # Windows ApplicationProgram
2. Add a Windows form label to form1.cs
3. Click the label1 control and change the text attribute to a null character.
4. Change the borderstyle attribute to fixedsingle.
5. Right-click form1.cs and
When developing C # winform, you sometimes need to drag a file or folder into the specified control. Obtain the information of the files or folders dragged in by the user and perform the next step.
There are many problems related to Baidu or
ArticleFrom: http://www.watch-life.net/csharp/csharp-detail-question-marks.html
I think you must have written the following similarCode:
Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->
String
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. Windows. forms;
Using system. diagnostics;
Using system. runtime. interopservices;
Using system. reflection;
Namespace onLyprocess
{
Static
Many times we need to use C #CodeWhen the form is in the current focus, perform other multi-button operations. For example, the operation is similar to that of QQ Ctrl + enter to send information. Use Form.The processcmdkey method is a good solution.
-- Datetime numeric type
System. datetime currenttime = new system. datetime ();
1.1 take the current year, month, day, hour, minute, second
Currenttime = system. datetime. now;
1.2 get current year
Int year = currenttime. Year;
1.3 take the current
Conversion from: getting the file path from mongoshake winform
String str1 = process. getcurrentprocess (). mainmodule. filename; // obtain the file name of the currently executed exe.String str2 = environment. currentdirectory; // obtain and set
C # obtain the pathString str1 = process. getcurrentprocess (). mainmodule. filename; // obtain the file name of the currently executed exe.String str2 = environment. currentdirectory; // obtain and set the fully qualified path of the current
1. # define
Macro definition. The pre-processor replaces the code with a string before compilation. Macro definition is not a statement, and ";" is not followed.
2. typedef
Typedef is processed during compilation, and an existing type and alias are
Using system;
Namespace binarytree
{
// Binary Tree node class
Class Node
{
Public int data {Get; set ;}
Public node leftsubnode {Get; set ;}
Public node rightsubnode {Get; set ;}
// Add a child node to the node itself (and add a child node to the
1. datetime numeric type
System. datetime currenttime = new system. datetime ();
1.1 take the current year, month, day, hour, minute, secondCurrenttime = system. datetime. now;1.2 get current yearInt year = currenttime. Year;1.3 take the current
Public controls
Button BTN button
Checkbox chk check box
Checkedlistbox CKL displays a list of items. Each item has a check box on the left.
ComboBox CMB drop-down list box
Datetimepicker DTP Time Control
Label LBL text list
Linklabel LLB supports
C #3.0 the extension method is to add a method to the existing type.// Demo -- 1 // extended basic type namespace testextensionmethods {
// A static class must be created to include the extension method public static class extensions {
// The
/// /// Create a line chart/// /// center x value /// center point y value /// X, Y axis length /// X axis description /// Y axis description /// X Data /// Y data /// obtain the maximum Y axis data from the database
Public bitmap
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