如何将值从一种形式传递到下一种形式.vb [英] How to carry a value from one form to the next.vb

查看:72
本文介绍了如何将值从一种形式传递到下一种形式.vb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我得到了这个triva有点游戏,当你得到一个问题时,你得到一个观点。但是我喜欢15种不同的形式(当然在1个项目中),所以我如何在最后的15个(一旦完成所有问题)中显示出价值(有多少是正确的)? div class =h2_lin>解决方案

由于这个问题非常受欢迎,我之前的答案常常没有得到很好的理解,可能还不够清楚,我决定写一个提示/技巧文章完整的详细代码示例和解释:一次回答的许多问题 - 协作在Windows窗体或WPF Windows之间



-SA


我相信你可以使用环境整数变量来更新/保存/检索总分。

你的my.settings.variable将从0开始(比方说)并且表单中的每个正确答案都会添加其得分到变量,保存和重新加载设置

最后,您只需检索变量并将其放在标签中作为.tostring(或者您可以将其保存为整数,如您所愿)


So i got this triva kinda game, and when you get a question right you get a point. But I have like 15quesions all on different forms (within the 1 project of course), so how do I show the value(how ever many the got right) out of 15 at the end (once they have finished all the questions)?

解决方案

As the question turned out to be very popular, and my previous answers often were not well understood, probably were not clear enough, I decided to write a Tips/Trick article complete with detailed code samples and explanations: Many Questions Answered at Once — Collaboration between Windows Forms or WPF Windows.

—SA


I believe you may use an environment integer variable to update / save / retrieve the total score.
your my.settings.variable will start from 0 (let's say) and every right answer in the forms will simply add its score to the variable, save and reload settings
In the end you simply retrieve the variable and place it in a label as .tostring (or you can keep it as an integer, as you wish)


这篇关于如何将值从一种形式传递到下一种形式.vb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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