本文介绍了当show()方法调用时,我的对象没有显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

i我正在使用一段代码





form1的对象类/表格没有出现请帮助在time_elapsed body中显示它



我尝试了什么:



无效MainWindow_Loaded(对象发送者,RoutedEventArgs e)

{



timer = new Timer() ;

timer.Interval = 1000;

timer.Elapsed + = timer_Elapsed;



timer.Start( );

}

void timer_Elapsed(对象发送者,ElapsedEventArgs e)

{

form1 object = new form1 ();

object.Show()



}

解决方案



hi everyone
i am using a piece of code as under


the object of the form1 class/form doesn't appears please help to display it within the time_elapsed body

What I have tried:

void MainWindow_Loaded(object sender, RoutedEventArgs e)
{

timer = new Timer();
timer.Interval = 1000;
timer.Elapsed += timer_Elapsed;

timer.Start();
}
void timer_Elapsed(object sender, ElapsedEventArgs e)
{
form1 object = new form1();
object.Show()

}

解决方案



这篇关于当show()方法调用时,我的对象没有显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 11:00