用C#和SQL编码 [英] Coding in C# and SQL

查看:56
本文介绍了用C#和SQL编码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.我想知道是否有人可以为我提供帮助?我目前不熟悉C#,并且正在尝试构建Windows窗体应用程序.此应用程序的目的是存储客户信息,例如:


姓氏
配偶名称
就业
就业(配偶第二名)
街道地址
状态
邮编
撰写日期
安装日期
上次交流
下次通讯

我想将这些字段链接到一个单独的表单.一个Form 2我将创建一些与Form 1相同名称的字段,并希望将其链接起来,以便Form 1的该行上的信息将填充Form 2中的相关字段.

我的问题是,在不使用按钮的情况下进行链接的最佳方法是什么?我有点希望通过用户双击来做到这一点.在此先感谢您提供的所有帮助.

Hello. I was wondering if someone might be able to provide me some assistance? I am currently new to using C#, and I am trying to build a Windows Form Application. The purpose of this application is to store customer information, such as:

First Name
Last Name
Spousal Name
Employment
Employment (2nd one for the spouse)
Street Address
State
Zip code
Date Written
Date Installed
Last Communication
Next Communication

I am wanting to link these fields to a separate form. One Form 2 I''ll create some fields with the same name as Form 1 and want to link it so that the information on that row of Form 1 will fill in the related fields in Form 2.

My question is what is the best possible way for me to go about doing the linking without using a button? I was kind of hoping to get that to do it on a user double-click. Thanks in advance for all help.

推荐答案

我将在某些视图上查找事件.例如,您可能具有listView来查看所有信息.在属性窗口中,有一张雷电螺栓的图片.单击它,您将获得相当多的对象可能发生的事情的列表.例如,MouseDoubleClick.当您看到想要的事件时,双击它,您将为您准备好处理程序和事件.您所要做的就是告诉事件发生后会发生什么.
I''d look up the events on the certain views. For example you might have a listView to view all your information. In the properties window, there is a picture of a thunder bolt. Click it, you will get a quite a big list of things that could happen to the object. For example MouseDoubleClick. When you see the event you want, double click it and you will get your hanlder and event all set up for you. All you have to do is tell it what will happen after that events happens.


如果这样做是出于娱乐目的,那么C#和SQL是两种语言,那么您将是最好的学习方法一次一个.更好的是,读一本书.您应该学习C#,然后学习winforms,然后学习如何添加数据层.

如果正在做家庭作业,那么您应该与您的老师交谈.

如果是有偿工作,那显然是可耻的.

如果愿意,您可以处理双击事件.您可以使用委托来链接两个表单之间的更改.每个控件都有一个双击事件,但是如果没有显示用户可以单击的UI,那并不是真正的用户直观.
If this is being done for fun, then C# and SQL are two languages, you''d be best learning one at a time. Better still, work through a book. You should learn C#, then learn winforms, then learn how to add a data layer.

If it''s being done for homework, then you should talk to your teacher.

If it''s paid work, then that''s obviously disgraceful.

You can handle a double click event if you like. You''d use delegates to link the changes between the two forms. Every control has a double click event, but that''s not really user intuitive, if there''s no UI showing they can click.


这篇关于用C#和SQL编码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆