当我从form1按下button1时,仅显示form2的特定内容 [英] Only display a specific content of the form2 when I press button1 from form1

查看:90
本文介绍了当我从form1按下button1时,仅显示form2的特定内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只显示form2的特定内容,当我从form1按下button2时,只显示form2的另一个特定的where2,这样我就不需要创建多个表单,任何人都知道怎么做那个?



我尝试了什么:



i试图做一个搜索按钮之前,但我认为它失败了,如果有人知道该怎么做,并且有方法请给我解决方案,ty。



(搜索按钮解释:像票证系统一样,选择时间,并显示可用的插槽。)

only display a specific content of the form2 when i press button1 from form1, and display only display another specific contect of the form2 when i press button2 from form1, so that i dont need to create many form, anyone know how to do that?

What I have tried:

i tried to do a search button before, but i think its failed, if any one know how to do, and have the method please give me the solution, ty.

(search button explain: like ticket system, choose the time, and show the available slot.)

推荐答案

你的问题不是很清楚,但我认为你的意思是:

用户单击Form1上的一个按钮,这会打开一个Form2,在那里他选择时间,然后转回Form1以显示可用的插槽?



如果是这样,那么很简单:在Form2上创建一个返回数据的属性,并使用ShowDialog显示表单:

Your question isn't very clear, but I assume you mean:
User clicks a button on Form1, this opens a Form2 where he chooses the time, and that is transferred back to Form1 to show the available slot?

If so, then it's simple: create a Property on Form2 which returns the data, and use ShowDialog to display the form:
Dim f2 As Form2 = New Form2()

If Form2.ShowDialog() = DialogResult.OK Then
    Dim myString As String = f2.StringResult
    ...
End If

如果这不是你的意思,那么请记住我们看不到你的屏幕,访问你的硬盘或读你的想法 - 我们只能得到你输入的确切内容有 - 所以试着更准确地解释你想要做什么以及你遇到了什么问题,我们会尽力帮助你。

If that isn't what you mean, then remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - so try to explain in a lot more detail exactly what you are trying to do and what problems you have met, and we'll try to help you.


这篇关于当我从form1按下button1时,仅显示form2的特定内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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