如何从form2调用form1的事件 [英] how to call a event of form1 from form2

查看:121
本文介绍了如何从form2调用form1的事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个表格. Form1有1个listview(columnname,columnvalue); form2有一个按钮(更新)和一个文本框(txtvalue).

要求是当单击列表视图的任何行时,程序将发送与form2对应的值,并且当单击按钮更新为txtvalue的值时,该值将更新为列表视图,并且行(item)具有culomnvalue等于txtvalue将具有黄色背景.

请帮帮我吗?
谢谢!

I have 2 form. Form1 has 1 listview(columnname,columnvalue ); form2 have a button(update) and a textbox(txtvalue).

Requirement is when click on any line of listview, program will send value corresponding to form2 and when click button update is value of txtvalue will update into listview and line(item) has culomnvalue equal txtvalue will had background is yellow.

help me please?
thanks!

推荐答案

在单击列表视图时,在下面的代码中写上
On click of listview write below code,
From2.fnShow(txtValue)


在Form2中编写以下函数,


In Form2 write below function,

Public Function fnShow(Byval strValue as String)
txtValue.Text = strValue 
End Function


然后单击更新按钮


Then click the update button


上周(并在此之前几次)询问并回答.搜索该站点-您将找到它.
Asked and answered last week (and several times before that). Search the site - you''ll find it.


这篇关于如何从form2调用form1的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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