如何将来自不同形式的组合框中的数据用于另一种形式 [英] How do you use the data from a combobox located from a different form onto another form

查看:87
本文介绍了如何将来自不同形式的组合框中的数据用于另一种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果你能帮助我解决这个问题,我真的很感激。
所以我有一个很大的问题。我需要使用存储在组合框中的数据从存储的表单中以另一种形式使用。
基本上我是在10级别上制作一个自驾旅行应用程序,在第一个表格上你选择了开始,结束和目的地点但是当你输入show route时它会打开另一个表格。我想知道如何使用之前组合框中的数据制作if和else语句并将路线方向输出到备忘录中。

我尝试过:

< pre>我已经尝试在方向表单的OnCreate上声明起点和终点但是没有任何效果,但运行时没有错误。

解决方案

与在类之间传递任何信息的方式相同。在第二种形式(或替代构造函数)中创建一个方法,该方法将第一个表单从组合框中获取的信息作为其参数。请参阅在两个表单之间传输信息,第1部分:父对象 [ ^ ]。

HI everyone i would really appreciate it if you could help me with this problem
so i have a huge problem . i need to use the data stored in a combo box from a form which it is stored in to be used in another form. 
basically im making a roadtrip app at a grade 10 level where on the first form you pick the starting , ending and destination point but when you type show route it opens up onto another form. i wanted to know how can i use the data from the previous comboboxes to make an if and else statement and output the route direction onto a memo.

What I have tried:

<pre>i have tried declaring the starting point and ending point on the OnCreate of the direction form but nothing has worked but there are no errors when i run it.

解决方案

The same way you pass any information between classes. Create a method in the second form (or an alternative constructor) that takes as its parameter(s) the information that the first form gets from the combobox. See Transferring information between two forms, Part 1: Parent to Child[^].


这篇关于如何将来自不同形式的组合框中的数据用于另一种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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