今年遇到了C#开发的一个前端,由于体量很小,已经不能称为架构了
虽然小,但是业务流程比较完全,由于是第一次接触C#
一些问题记录一下给自己看
主要由Frm.cs文件、Frm.designer.cs文件、配置文件、和资源四个部分组成。新涉及了从别的项目迁入窗口,如何从别的项目迁入窗口,将在4中详细介绍//第二次编辑
--首先在Frm.designer.cs文件中添加控件、例如button、txt等
----控件添加分成1定义、2添加事件、3添加到控件三个部分
1.
private CCWin.SkinControl.SkinTextBox txt_AAA;
this.txt_AAA = new CCWin.SkinControl.SkinTextBox();
2.
this.txt_AAA.BackColor = System.Drawing.Color.Transparent;
this.txt_AAA.DownBack = null;
this.txt_AAA.Icon = null;
this.txt_AAA.IconIsButton = false;
this.txt_AAA.IconMouseState = CCWin.SkinClass.ControlState.Normal;
this.txt_AAA.IsPasswordChat = '\0';
this.txt_AAA.IsSystemPasswordChar = false;
this.txt_AAA.Lines = new string[0];
this.txt_AAA.Location = new System.Drawing.Point(320, 220);
this.txt_AAA.Margin = new System.Windows.Forms.Padding(0);
this.txt_AAA.MaxLength = 32767;
this.txt_AAA.MinimumSize = new System.Drawing.Size(28, 28);
this.txt_AAA.MouseBack = null;
this.txt_AAA.MouseState = CCWin.SkinClass.ControlState.Normal;
this.txt_AAA.Multiline = true;
this.txt_AAA.Name = "txt_AAA";
this.txt_AAA.NormlBack = null;
this.txt_AAA.Padding = new System.Windows.Forms.Padding(5);
this.txt_AAA.ReadOnly = true;
this.txt_AAA.ScrollBars = System.Windows.Forms.ScrollBars.None;
this.txt_AAA.Size = new System.Drawing.Size(361, 42);
3.有的层次结构下需要添加
--然后在Frm.cs文件中对事件编程
private void btn_save_Click(object sender, EventArgs e)
{}
--最后进行数据库通信的工作
4.从其他项目中迁入窗体
首先将需要的三个文件拷贝到相应的文件夹下,即AAA.cs,AAA.Designer.cs,AAA.resx
然后按照https://blog.youkuaiyun.com/youngprogrammer/article/details/68489635中的方法修改配置文件即可