且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用datagridview在C#中创建调查表?

更新时间:2022-06-20 08:15:09

您好,
我认为这可能是一些可能的解决方案:

1.创建具有4列的dataGridView:

问题编号我的问题我可能的答案我的答案

textBox textBox comboBox textBox

1.问题1答案1:是/否
1.
2.
3.
2.问题2答案2:对/错
1.
2.
3.

3.问题3答案3:对/错
1.
2.
3.

. .
. .
. .
.问题n答案n:是/否
1.
2.
3.



2.在1.列中,输入问题编号
3.在2.列中输入问题
4.在3.列中,输入可能的答案
5.在4.列中,该值应取决于在3.列中选择的内容.

您应该检查是否在comboBoxes中选择了答案的值
对应于真实答案.如果您有少量问题,可以
用户在组合框中选择答案后立即检查答案是否为
足够:将事件用于comboBoxes.如果答案正确或否,
在4.列中插入文本"true"或"false".

6.也许您将需要允许用户显示所有内容的按钮
通过单击答案,您可以在第4列中插入正确答案.

7.也许您需要对用户可以看到的结果进行一些控制.
评论他的性格或其他内容.带有完整注释的RichTextBox ...

8.仔细说明槽程序简介这是一种什么样的测试,
您的程序使用了什么样的科学依据,所以用户不会理解
感到困惑或侮辱.

这些只是我在开发此类程序时会使用的一些准则,
但这与C#中的实际伪代码,算法和程序代码仍然相去甚远.
也许您会找到一些程序,使您可以创建自己的问题测试,并可以作为独立程序执行.

一切顺利,
Hello,
I think that this would be some of the possible solutions:

1. Create dataGridView with 4 columns :

Question number I Question I Possible Answer I Answer I

textBox textBox comboBox textBox

1. Question 1 Answer 1 : true/false
1.
2.
3.
2. Question 2 Answer 2 : true/false
1.
2.
3.

3. Question 3 Answer 3 : true/false
1.
2.
3.

. .
. .
. .
n. Question n Answer n : true/false
1.
2.
3.



2. In 1. column you put the number of question
3. In 2. column you put the question
4. In 3. column you put the possible answers
5. In 4. column the value should depends on what is the selected in 3. column.

You should check if the value of the selected answer in comboBoxes
corresponds to real answer. If you have small number of questions you could
immediately afther the user select answer in comboBox to check if the answer
is adequate : Use the events for comboBoxes.If the answer is correct or no,
in the 4. column insert text "true" or "false".

6. Maybe you shall need the button that allows to user to reveal all
the answers, by clicking on it, you insert right answers to 4. column.

7. Perhaps you need some control for results that user can see.
Comments on his personality or something else.RichTextBox with full coment...

8. Carefully explain trough program intro what kind of test is it and
what kind of scientific bases your''s program use, so the user don''t get
confused or insulted.

These are just some of the guidelines that I would use in developing such a program ,
but it''s still far, far from an actual pseudo code, algorithms and program code in C #.
Perhaps you could find some programs that allows you to create your own question test that could execute as standalone program.

All the best,


我们不做您的作业:这是有原因的.在这里,您可以考虑自己被告知的内容,并尝试理解它.也可以在那里帮助您的导师识别您的弱点,并将更多的注意力放在补救措施上.

自己尝试,您可能会发现它比您想象的要容易.如果您遇到特定问题,请随时询问,我们将尽力提供帮助.
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is easier than you think. If you get a specific problem, feel free to ask about that, and we will try to help.