<分区>
我在 C# 中遇到 Windows 窗体应用程序问题 在这个应用程序中有一个选项卡式浏览器。现在我希望在一个循环中(我在其中执行一些操作来计算下一个 url)我可以在 AddTab 之间添加延迟。
即
foreach(Urls url in Links){
// Do something with url
if(url.Host == "google"){ //if host is google until start the
// next AddTab i would wait 5 SEC
addTab(url);
//Here i Tried to use Sleep Thread , While(TimeCur-TimePre) {} but i always
// get Freezing and the other Tabs dont continue the loading
Wait 5 Seconds in somehow
}
}
正如我所写,我不想使用 Thread Sleep,因为它会卡住我的表单应用程序。我已经使用了 TimeCur-TimeSaved+(x Second) 的时间技巧,但这也会卡住表格。
我看到很多主题都说要使用定时器,所以我尝试使用它们(没有任何结果,也许我错了什么)
我可以在此循环中添加什么来延迟 AddTab 之间的打开而不卡住任何内容?