小编kk6*_*axq的帖子

在Python中将字符串按空格分割成最大长度的子字符串

我有一个像这样的字符串:

Trump, Defending Himself After Flynn Guilty Plea, Says FBI Is in 'Tatters' | CVS to Buy Aetna for $69 Billion in a Deal that May Reshape the Health Industry | Joy Reid Apologizes for Past Anti-Gay Articles: 'Insensitive, Tone Deaf and Dumb' | California 18-year-old confesses to molesting dozens of children | Bill Belichick Apologizes for Rob Gronkowski's Late Hit, Calls It 'Bulls--t' | Met Opera Suspends James Levine After New Sexual Abuse Accusations | Like it or not, …
Run Code Online (Sandbox Code Playgroud)

python string rss parsing text

3
推荐指数
1
解决办法
3808
查看次数

while循环中更改的标签不会更新UI

运行此代码时:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
    public MainWindow()
    {
        while (true)
        {

            InitializeComponent();

            DateTime dtCurrentTime = DateTime.Now;
            label1.Content = dtCurrentTime.ToLongTimeString();
        }
    }

}
}
Run Code Online (Sandbox Code Playgroud)

要经常更新标签,窗口永远不会打开.但是,当我删除while循环时,它可以工作,但它只是不更新​​标签...那么如何在没有任何用户输入的情况下更新标签以显示当前时间?谢谢,L

c# wpf loops

0
推荐指数
1
解决办法
4559
查看次数

标签 统计

c# ×1

loops ×1

parsing ×1

python ×1

rss ×1

string ×1

text ×1

wpf ×1