Using system. runtime. interopservices; [dllimport ("USER32")] Private Static extern bool animatewindow (intptr hwnd, int dwtime, int dwflags); // The following are available constants, declare the required private const int aw_hor_positive = 0x0001
Add the following to program. CS:Code: Boolean creatednew; // indicates whether the initial ownership of the mutex used by the thread is granted.System. Threading. mutex instance = new system. Threading. mutex (true, "mutexname", out creatednew); //
After entering the window, the system will focus on a text box by default. There are two methods:
① Set tabindex
PutTabindex is set to 0, The focus is in this text box by default.
② Activated event of winform
In formAdd textbox1.focus () to the
Method 1:
Use the help class provided by. NET Framework to call the CHM help file.
ToProgramCall the showHelp and showhelpindex static methods in the help class.
For example:
1. display the Help file content at the specified URL.
String
Copyright statement: Reprinted with a hyperlinkArticleSource and author information and this statementHttp://greenlandy.blogbus.com/logs/14388828.html Code snippet
[Stathread]
Private Static VoidMain ()
{
Application. Enablevisualstyles (
Analysis of the key causes of flickering images:
1. During the repainting operation due to the size and position status changes in the drawing windowEach time the content or size of the drawing window changes, you must call the paint event to
I. ApplicationProgram
// Obtain the complete path of the current process, including the file name (process name ).String STR = This. GetType (). Assembly. location;Result: X: \ XXX \ xxx.exe (.exefile directory. .exe file name)
// Obtain the
C # Hide the window appllication as the taskbar icon when writing the minimal code.1. Set the winform attribute showintask to false.
2. Add the policyicon control policyicon1 to add an icon for the property icon of the control policyicon1.
3. Add
Datetime. tostring (string, iformatprovider)
Detailed usage of the format parameter:
Format characters
Association property/Description
D
Shortdatepattern
D
Longdatepattern
F
通用类">
通用类">
///
///
Datatable to list & lt; Model & gt;
///
Public
Static
Class
Datatabletolistmodel
Where
T:
New
()
{
Public
Static
Ilist converttomodel (datatable DT)
{
//
Define a
Using system. text;Byte [] to stringByte [] image;String LL = encoding. Default. getstring (image );
String to byte []
String SS;
Byte [] B = encoding. Default. getbytes (SS );
Processing of Image Fields in the database.
First, I want to
View code
Using System;
Using System. Collections. Generic;
Using System. LINQ;
Using System. text;
Using System. Windows. forms;
Using Microsoft. Office. InterOP. Excel;
Namespace Saleapplication. Class
{
Class Exportexcelofwinform
{
Steps:
1. Place a container (such as panel) in the form and set the container's Dock attribute to fill. Other controls in the form are placed in this container.
2. Create a form class that inherits from the original form class and adds the
First you need to add reference Microsoft Excel 11.0 Object Library
Add method: select project-> reference-> right-click "add reference"-> select com to find the above component-> click "OK ".
ImplementationCodeAs follows:
Private void export
Original post address: http://topic.csdn.net/u/20071213/13/84ef4ed6-e869-46f4-ba86-fa82d90c5288.html
If you want to customize it, you can use the following method:
C # code
C # implement shortcut key (system hotkey)
To make your winform more dazzling and beautiful, it is far from enough to have beautiful static parts such as the C # skin and background textures, you also need some dynamic support to make yourProgramThe interface provides a better user
Using System;
Using System. reflection;
NamespaceTestreflection{ClassProgram{Static VoidMain (String[] ARGs){INAME name = abstractfactory. getname ();Name. showname ();}}
// abstract factory class Public class abstractfactory {
Implementation Methods: There are three categories of implementation: CAT, mouse, and primary human.
Cat class: defines a cat call event;
Mouse: subscribe to a cat call event. After the call, the mouse escapes;
Primary Human: similar to a
To read an object, follow these steps:
1. Declare and use the openread of file to instantiate a file stream object, as shown below:
2. Prepare a byte array for storing the file content. fs. length will get the actual size of the file, as shown
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