日期时间问题 [英] Date Time question

查看:98
本文介绍了日期时间问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用时间不断变化来表达

的时间。我可以获得

它显示一次,但是它保持这种状态,

使用循环阻塞。有没有办法做到这一点?


I would like to express the time with
the time continually changing. I can get
it to show once, but then it stays that way,
using a loop jams. Is there a way to do this?


推荐答案

如果这是一个Web应用程序,你需要这样做客户端(即

javascript)。


如果这是一个Windows应用程序,一种方法是添加一个计时器到

winform,周期为(比方说)一秒(或分钟......)和刷新当计时器事件发生时,时间




Scott


" Zach" < 00@00.00>在消息中写道

news:43 *********************** @ news.freeler.nl ...
If this is a web application, you would need to do it client side (ie
javascript).

If this is a windows application, one way would be to add a timer to the
winform with a period of (say) a second (or minute..) and "refresh" the time
when the timer event fires.

Scott

"Zach" <00@00.00> wrote in message
news:43***********************@news.freeler.nl...
我想用时间来表达时间不断变化。我可以让它显示一次,但它会保持这种状态,
使用循环阻塞。有没有办法做到这一点?
I would like to express the time with
the time continually changing. I can get
it to show once, but then it stays that way,
using a loop jams. Is there a way to do this?



不,它不是网络应用


如果我代码


而(真实)

{

//在文本框中显示时间

}


应用程序块。

我该怎么办才能阻止它阻止?


Zach

" Scott" < SD ****** @ gmail.HEY_YOU.com>在消息中写道

news:e9 ************** @ TK2MSFTNGP11.phx.gbl ...
No it isn''t a web application

if I code

while(true)
{
// show the time in a textBox
}

The app blocks.
What can I do to stop it from blocking?

Zach
"Scott" <sd******@gmail.HEY_YOU.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
如果这是一个网络应用程序,你需要做客户端(即
javascript)。

如果这是一个Windows应用程序,一种方法是添加一个计时器到
winform与一段(比如说)一段时间(或分钟......)和刷新一段时间。计时器事件发生时的
时间。

Scott

Zach < 00@00.00>在消息中写道
新闻:43 *********************** @ news.freeler.nl ...
If this is a web application, you would need to do it client side (ie
javascript).

If this is a windows application, one way would be to add a timer to the
winform with a period of (say) a second (or minute..) and "refresh" the time when the timer event fires.

Scott

"Zach" <00@00.00> wrote in message
news:43***********************@news.freeler.nl...
我想用时间不断变化来表达时间。我可以让它显示一次,但它会保持这种状态,
使用循环阻塞。有没有办法做到这一点?
I would like to express the time with
the time continually changing. I can get
it to show once, but then it stays that way,
using a loop jams. Is there a way to do this?




Hi Zach,

斯科特指出你需要使用像Timer这样的东西。如果您在设计视图中转到工具箱,您将看到一个计时器组件,将它拖到您的表单上,您现在可以将其间隔属性设置为1秒(I相信

它基于毫秒,因此您必须将其设置为1000)然后您需要添加一个事件处理程序来处理Tick事件,该事件将触发每个

1000ms。在这种情况下,您可以使用

当前时间更新表格上的标签。


希望有帮助

Mark R Dawson
http://www.markdawson.org



" Zach"写道:
Hi Zach,
as Scott pointed out you will need to use something like a Timer. If you
go to the toolbox in design view you will see a Timer Components, drag it
onto your form, you can now set its interval property to 1 second (I believe
it is based on milliseconds so you will have to set it to 1000) then you
need to add an event handler to handle the Tick event which will fire every
1000ms. In this event you can update the label you have on the form with the
current time.

Hope that helps
Mark R Dawson
http://www.markdawson.org


"Zach" wrote:
不,它不是网络应用程序

如果我编码

while(true)
{
//在文本框中显示时间
}

应用程序阻止。
我该怎么做才能阻止它阻止?
Zach

" Scott" < SD ****** @ gmail.HEY_YOU.com>在消息中写道
新闻:e9 ************** @ TK2MSFTNGP11.phx.gbl ...
No it isn''t a web application

if I code

while(true)
{
// show the time in a textBox
}

The app blocks.
What can I do to stop it from blocking?

Zach
"Scott" <sd******@gmail.HEY_YOU.com> wrote in message
news:e9**************@TK2MSFTNGP11.phx.gbl...
如果这是一个Web应用程序,你会需要做客户端(即
javascript)。

如果这是一个Windows应用程序,一种方法是在
winform中添加一个计时器,其周期为(说)第二(或分钟......)和刷新当计时器事件触发时,
If this is a web application, you would need to do it client side (ie
javascript).

If this is a windows application, one way would be to add a timer to the
winform with a period of (say) a second (or minute..) and "refresh" the


时间



Scott

Zach < 00@00.00>在消息中写道
新闻:43 *********************** @ news.freeler.nl ...
when the timer event fires.

Scott

"Zach" <00@00.00> wrote in message
news:43***********************@news.freeler.nl...
我想用时间不断变化来表达时间。我可以让它显示一次,但它会保持这种状态,
使用循环阻塞。有没有办法做到这一点?
I would like to express the time with
the time continually changing. I can get
it to show once, but then it stays that way,
using a loop jams. Is there a way to do this?





这篇关于日期时间问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆