关闭窗口后刷新列表视图 [英] Listview Refresh after closing window

查看:76
本文介绍了关闭窗口后刷新列表视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.
我有一个关于在窗口中刷新listview的问题.看起来像是:
我在window1的收据上看到装有产品的窗口.在此窗口中,我还有一个按钮用于在两个收据之间分割产品.例如,我有产品:
产品1 10 $
产品2 5,5%
产品3 20 $
当我按下按钮进行拆分(此按钮显示新窗口,称为Window2)时,我可以将产品从左侧移动到另一个收据中,例如:
收据1:
产品2
产品3

收据2:
产品1.

因此,在window2中,我有2个控件ListView(receipt1,receiving2)和确定"按钮.当我单击此按钮时,我想关闭窗口2,然后返回到window1,但仅包含来自receive1(在listview上)的项目.所以实际上是这样的:
窗口1:包含所有产品的收据+用于拆分收据的按钮
单击此按钮:window1不透明度= 0.2,window2不透明度= 1
window2.show,选择要在旧收据(来自win1)和新收据之间进行拆分的元素.
在window2上单击确定":window2.close,window1.opacity = 1,现在刷新列表视图中的项目.

Hello.
I have a question about refreshing listview in window. It looks like :
I have window with products on receipt on window1. on this window i have also button to split products between two receipts. So for example i have products:
Product1 10$
Product2 5,5%
Product3 20$
When i press button to split (this button show new window, lets call it Window2) i can move product from left side into another receipt, for example like:
Receipt1:
Product2
Product3

Receipt2:
Product1.

So in window2 i have 2 controls ListView (receipt1, receipt2) and button ''OK''. When i click this button i want to close window 2, and come back to window1, but only with items from receipt1 (on listview). So actually its like :
Window 1: receipt with all products + button to split receipt
Click on this button : window1 opacity = 0.2, window2 opacity = 1
window2.show, choose element to split between old receipt(from win1) and new one.
click ok on window2: window2.close, window1.opacity = 1 and now refresh items in listview.
is it possible to somehow refresh this window or even listview on it?

推荐答案


产品2 5,5%
产品3 20

Product2 5,5%
Product3 20



当我按下按钮进行拆分(此按钮显示新窗口,称为Window2)时,我可以将产品从左侧移动到另一个收据中,例如:
收据1:
产品2
产品3

收据2:
产品1.

因此,在window2中,我有2个控件ListView(receipt1,receiving2)和确定"按钮.当我单击此按钮时,我想关闭窗口2,然后返回到window1,但仅包含来自receive1(在listview上)的项目.所以实际上是这样的:
窗口1:包含所有产品的收据+用于拆分收据的按钮
单击此按钮:window1不透明度= 0.2,window2不透明度= 1
window2.show,选择要在旧收据(来自win1)和新收据之间进行拆分的元素.
在window2上单击确定":window2.close,window1.opacity = 1,现在刷新列表视图中的项目.
是否有可能以某种方式刷新此窗口甚至是其上的列表视图?

When i press button to split (this button show new window, lets call it Window2) i can move product from left side into another receipt, for example like:
Receipt1:
Product2
Product3

Receipt2:
Product1.

So in window2 i have 2 controls ListView (receipt1, receipt2) and button ''OK''. When i click this button i want to close window 2, and come back to window1, but only with items from receipt1 (on listview). So actually its like :
Window 1: receipt with all products + button to split receipt
Click on this button : window1 opacity = 0.2, window2 opacity = 1
window2.show, choose element to split between old receipt(from win1) and new one.
click ok on window2: window2.close, window1.opacity = 1 and now refresh items in listview.
is it possible to somehow refresh this window or even listview on it?


这个问题有很多细节,但是非常令人困惑.如果只想刷新列表视图,我的建议是listview.Items.Refresh(),否则,如果要通过不同的窗口来回传递数据.您需要创建属性,然后在创建和调用窗口的新实例时来回发送信息.例如:

弦产品;

This question has a lot of detail but its very confusing. My advice to you if you just want to simply refresh i listview is listview.Items.Refresh(), Otherwise if you want to be passing data back and forward through different windows. You need to create Properties and then send the information back and forward when creating and calling new instances of the windows. For example:

string Products;

public string products
{
  get { return Products; }
  set { Products = value; }
}




访问产品时

WindowName WN =新的WindowName();
WN.Products =新值";
WN.ShowDialog();

有关此问题的更多信息,请与您联系.
http://msdn.microsoft.com/en-us/library/x9fsa0sw (v = vs.80).aspx [




When accessing Products

WindowName WN = new WindowName();
WN.Products = "new values";
WN.ShowDialog();

For more information on this if it doesnt make sence to you.
http://msdn.microsoft.com/en-us/library/x9fsa0sw(v=vs.80).aspx[^]

Tried to help from what i could understand from the question :) hope it can be of some use to you.
Storxstar


这篇关于关闭窗口后刷新列表视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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