C Sharp窗体刷新 [英] C Sharp Window Form Refresh

查看:260
本文介绍了C Sharp窗体刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何刷新另一张表格。

我已经在程序中制作了属性。

 例如:

主表格,子表格



H main打开Sub但是我想要sub的值到Main中的显示而不必关闭然后重新打开(Main_Load)。通过我所做的属性,

但是在那个时候需要一秒钟来续订。



主要有一个TxtMain。

H Sub有1个文本框和一个按钮。





  private   void  BtnSave_Click( object  sender,EventArgs e)
{
Properties.Settings.Default [ Price] = Convert.ToDouble (TxtSUB.Text);
Properties.Settings.Default.Save();
}



 



所以当你关闭表格OnClose()我想要获取属性值并将其放在TxtMain.Text中。与Main.Refresh()不是我的工作。

解决方案

请看这里:在两种表格之间传递信息,第2部分:儿童到父母 [ ^ ]


  this  .ParentForm.Textbox1.Text =   Somevalue ; 





  .ParentForm.Refresh(); 


how can I refresh a form from another.
I have made properties in the program.
  eg:

Main Form, Sub Form


H main opens Sub But I want the value of the sub to the display in Main without having to close and then re opened (Main_Load). through the properties I have made,
But at that time by one second to make renewal.

The Main has a TxtMain.
H Sub has 1 Textbox and a Button.


private void BtnSave_Click (object sender, EventArgs e)
         {
             Properties.Settings.Default ["Price"] = Convert.ToDouble (TxtSUB.Text);
             Properties.Settings.Default.Save ();
         }


 

So when you close the form OnClose () I want to get the property value and puts it in TxtMain.Text. with Main.Refresh () not my work.

解决方案

See here: Transferring information between two forms, Part 2: Child to Parent[^]


this.ParentForm.Textbox1.Text = "Somevalue";



this.ParentForm.Refresh();


这篇关于C Sharp窗体刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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