如何以窗口形式刷新标签(how to refresh a label in window form)

   IT问题网   2021-02-18 00:00:00

问 题

大家好



如何在windows窗体中每1秒刷新一次标签,



我正在用标签工作



其中

 lbl_time.text = datetime.now.tostring(); 




它必须刷新每一秒我该怎么办?

请发给我代码。



编辑:代码格式化

解决方案

使用timermicrosoft站点上的链接

将计时器对象添加到windows窗体并保持1秒的间隔,并在计时器对象elapsed事件中添加
 lbl_time.text = datetime.now.tostring(); 

标签:何以窗口形式情势刷新标签



分享:

  • 微信
  • QQ好友
  • QQ空间
  • 新浪微博


热门推荐

有谁知道PhotoShop的autocolor功能的算法?(Anyone knows the algorithm of PhotoShop's autocolor function)

problem hello, everyone since photoshop 7, ps has three ...

一些基本问题(some basic questions)

problem 1) what is early binding and late binding 2) wha ...

CheckBox中的内联代码(Inline code in CheckBox)

problem hi all, i want to set checkboxes checked proper ...

class structure.Net oops(class structure.Net oops)

problem 1.what is the difference between clas ...

手动添加服务引用(Manually add a service reference)

problem hello all, currently i am working on a web site ...

arraylist到memorystream c#(arraylist to memorystream c#)

problem hiii all... i have an arraylist with user define ...

在DispatchMessage崩溃,为什么?(Crash in DispatchMessage, why)

problem hi, dear all: i have a worker thread which have ...

导出HTML内容以打开办公室应用程序时出现问题。(Problem when export an HTML content to open office application.)

problem hello all. i am facing a problem when i am tryin ...

将数据从CSV导入Oracle(Importing Data from CSV to Oracle)

problem hi i want to import the data from csv to oracle, ...

如何使用存储过程传递id(how to pass id for where using stored procedure)

problem how to pass id for where condition when using mys ...

使用cookie值加载gridview(Load gridview using a cookie value)

problem i have a method to load a gridview according to a ...

只有添加足够的行才能启用垂直滚动条,才会显示ClistBox(ClistBox doesn't display until enough lines are added to enable the vertical scroll bar)

problem i have an application that adds lines to a list b ...

DateTime数据类型的算术运算。(Arithmetic Operations on DateTime Datatype.)

problem hi, i have been trying to find a way to do arit ...

将图像插入Word(Insert Image to Word)

problem how to compress inserted image in word using dsof ...

我如何缩进给定的XML(how can i indent a given XML)

problem is there any easiest way to indent given xml i ...

我想将Outlook消息保存到sql server db(i want to save outlook messages to sql server db)

problem hi could you please help me on saving outlook m ...

我如何在cookie中保存令牌(how I can save the token in the cookie)

problem hi, i am creating the web service au ...

C#.net中的ModalPopupExtender(ModalPopupExtender in C#.net)

problem while i am clicking the modal popup extender wind ...

需要帮助来更改密码表格(need help to change password form)

problem hi everyone, i am still newbie in vb. ...

CMap或CMapPtrToPtr(CMap or CMapPtrToPtr)

problem hi, i want store the objects in cmap ...