【发布时间】:2018-08-23 01:33:11
【问题描述】:
我想在从另一个窗体添加实体后更新 Windows 窗体 C# 中的面板,而不必使用 Application.Restart();
表格一:
private void kopf1_Load(object sender, EventArgs e)
{
kopf1.PopulateEntladeNr();
}
表格二:
private void button1_Click(object sender, EventArgs e)
{
// command object identifying the stored procedure
switch (MessageBox.Show("Are you sure you want to save this?",
"Verify",
MessageBoxButtons.YesNoCancel,
MessageBoxIcon.Question))
{
case DialogResult.Yes:
// "Yes" processing
{
Insert_WE();
Application.Restart();
}
break;
所以基本上在单击按钮后,我会在主窗体的组合框中找到添加的信息,就好像我确实重新启动了应用程序一样。请记住 f1.update() 不起作用。 那么有人可以帮忙吗?
【问题讨论】:
-
你有没有写过的代码
-
在主窗体中我有: private void kopf1_Load(object sender, EventArgs e) { kopf1.PopulateEntladeNr(); }
-
在另一种形式上,如果没有,我会生成一个 EntladeNr。我的问题是如何在生成它之后将它添加到主窗体中:Application.Restart()
-
所以本质上您是在尝试让数据以原始形式显示而无需重新启动?
-
@Twyxz 没错!
标签: c# insert updatepanel auto-update insert-update