当前位置:网站首页>Relevant knowledge under WinForm
Relevant knowledge under WinForm
2022-06-13 07:07:00 【AndroidOrCSharp】
1. String comparison equals, Constant before , Variables come later , In this way, it is not necessary to judge whether the variable is empty first
2. dataTable.copy();// Copy structure and data
dataTable.clone();// Just copy the structure , Don't copy data
3.BeginInit and EndInit
If a component implements ISupportInitialize Interface , Then the designer will generate BeginInit and EndInit.
The most important function of this interface is , The multiple BeginInit and EndInit The order between them is treated as a hammer deal .
Suppose a class , There are maximum and current values , The current value cannot be greater than the maximum value .
The problem is that the designer can hardly guarantee to set the maximum value first , Then set the current value ( Other controls may also be set My example ).
If it supports ISupportInitialize, that My Class understands that it is still in the initialization stage , Don't bother to check for errors , Don't bother to deal with every change
4. User controls and custom components and forms
User control : Custom reusable components , Easy to create , If the control has a large number of static layouts , User controls are preferred , Cannot be added to toolbox
Custom components : It is also a reusable component , Create with code , Difficult to create userControl class , Easier to use , Can be added to the toolbox , Compiled into dll
forms : Containers for both
5.DataTable and DataView Interconversion
DataView view = DataTable.DefaultView;
view.RowFilter = "BANKNO='5002'";//DataView Query criteria
view.Sort = "CHANNELID,NETPOINT,BANKNO,PAYWAY";//DataView Sort
DataTable.DataSource = view.Table;
6. Add a bullet box
MessageBox.Show(" Current working day TA Liquidation has been completed ", " System prompt ", MessageBoxButtons.OK, MessageBoxIcon.Information);
7. Add selection pop-up
DialogResult dateMessage = XtraMessageBox.Show(string.Format(" Header bill generation date :{0} And the current trading day :{1} atypism , Continue reconciliation ?", "1", "1"), " Tips ", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (dateMessage == DialogResult.No)
{
return;
}
8. Timing function
System.Diagnostics.Stopwatch singleStopwatch = new System.Diagnostics.Stopwatch();
singleStopwatch.Reset();singleStopwatch.Start();
singleStopwatch.Stop();
singleStopwatch.Elapsed.TotalSeconds;
9. Operation folder
// Determine if the directory exists , Create if it does not exist
if (!Directory.Exists(localDir))
{
Directory.CreateDirectory(localDir);
}
Directory.GetFiles(localDir)// Get all files in the file directory
10. Read line by line txt file
while (!file.EndOfStream)
{
var _row = file.ReadLine();
if (_rowNum == 1)
{
_row = System.Text.RegularExpressions.Regex.Replace(_row, @"\s+", "|"); // Convert spaces into | In order to intercept the string later , The replacement character must not appear in the original string
tradeNum = _row.Split('|')[0] is null ? ":0" : _row.Split('|')[0];// Intercepts the total number of transactions
tradeNum = tradeNum.Split(':')[1] is null ? "0" : tradeNum.Split(':')[1];
log.Info(string.Format(" The total number of transactions in the quick money reconciliation file :{0}", tradeNum))
}
}
边栏推荐
- What is online blind box e-commerce? Can blind box e-commerce become a new bonus market for the Internet?
- Issues related to C # delegation and events
- C # Advanced Programming - Feature Section
- Project analysis of Taishan crowdfunding mode: why is Taishan crowdfunding mode so popular?
- AIO Introduction (VIII)
- RT-Thread 模拟器 simulator LVGL控件:button 按钮样式
- Tree list under winfrom treelist related
- 杭州证券开户是安全的吗?
- Chain 2+1 reward, what kind of mode is beautiful everyday seconds?
- Differences between SQL and NoSQL of mongodb series
猜你喜欢

【RS-422与RS-485】RS-422与RS-485串行接口标准

对绘制丘岭密度图ridge plot的详细说明、重叠核密度估计曲线overlapping densities、FacetGrid对象、函数sns.kdeplot、函数FacetGrid.map

How to seize the bonus of social e-commerce through brand play to achieve growth and profit?

怎么写出一份令人惊叹的设计文档?

Br backup test

Tidb index optimization

SDN basic overview

Lightning breakpoint continuation

Evolution in the digital age

AIO Introduction (VIII)
随机推荐
[weak transient signal detection] matlab simulation of SVM detection method for weak transient signal under chaotic background
2022-06-12:在N*N的正方形棋盘中,有N*N个棋子,那么每个格子正好可以拥有一个棋子。 但是现在有些棋子聚集到一个格子上了,比如: 2 0 3 0 1 0 3 0 0 如上的二维数组代表,一
上位机开发(固件下载软件之编码调试)
2022 - 06 - 12: dans un échiquier carré n * N, il y a n * n pièces, donc chaque pièce peut avoir exactement une pièce. Mais maintenant quelques pièces sont rassemblées sur une grille, par exemple: 2 0
Make cer/pfx public and private key certificates and export CFCA application certificates
Recently, the popular social e-commerce marketing model, blind box e-commerce, how beautiful every second is accurately drained
Ansible PlayBook的中清单变量优先级分析及清单变量如何分离总结
玄武云科技通过上市聆讯:业绩波动明显,陈永辉等三人为控股股东
Upper computer development (code debugging of firmware download software)
Related operations under Oracle Database
面试必刷算法TOP101之单调栈 TOP31
基于SSM实现水果商城批发平台
杭州证券开户是安全的吗?
学习Mysql基础第一天
June 12, 2022: if there are n*n pieces in an n*n square chessboard, each grid can have exactly one piece. But now some pieces are gathered on a grid, such as 2030100300. The above two-dimensional arra
SDN基本概述
Ticdc introduction
Normalizing y-axis in histograms in R ggplot to proportion
Jinglianwen technology provides a one-stop smart home data acquisition and labeling solution
[Collection des questions d'examen les plus complètes de Tencent Ali] (quatre côtés: 3 tours de technologie + 1 tour de RH)