从用户控件VB.NET重新加载父表单的列表视图 [英] Reload listview of parent form from user control VB.NET

查看:127
本文介绍了从用户控件VB.NET重新加载父表单的列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我只是vb.net的新手。只是想寻求帮助..这是我的问题。我有一个父母表格,我称之为frmKitchen。在它里面,我有一个listview和一个用户控件。当我的用户控件发生变化时,我想重新加载listview中的所有项目。有人告诉我在我的UserControl中创建一个事件来表示任何用户。但我不知道怎么...我只是一个新手。请帮帮我。



我尝试过:



主要表格:



Hi guys, Im just a newbie in vb.net. Just want to ask for help.. Here's my problem. i have a parent form which i call frmKitchen. Inside it, i have a listview and an user control. I want to reload all the items in the listview when something change in my user control. someone told me to Create an event in my UserControl to signal that any subscriber. but i dont know how.. im just a newbie. please help me.

What I have tried:

main form:

Public Sub btnRefresh_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRefresh.Click
       selectDistOfItem()
       getAndDisplaySum()
       Me.Refresh()
   End Sub





用户控制:



User Control:

Private Sub lvOrders_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles lvOrders.DoubleClick
        If lvOrders.SelectedItems.Count > 0 Then
         'some codes here
        Dim kit As New frmKitchen
        kit.btnRefresh_Click(Nothing, Nothing)

        End If
    End Sub

推荐答案

所以,你在21小时前问过这个问题,这里 [ ^ ],得到了答案8.5小时前,然后决定忽略该答案并再次发布您的问题?



不酷。



无论您提出多少次问题,答案都不会改变。
So, you asked this question 21 hours ago, here[^], got the answer 8.5 hours ago, then decided to ignore that answer and post your question again?

Not cool.

The answer isn't going to change, no matter how many times you ask the question.


这篇关于从用户控件VB.NET重新加载父表单的列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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