Visual Basic时间教程 [英] Visual Basic Time Tutorial

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

问题描述

我需要VB的代码:-如果计算机中的时间是10:00 PM,请弹出对话框并告诉时间是10:00 PM,去睡觉"

任何身体都能帮忙吗?
Visual Basic !!

I need a code for VB :- If the time is 10:00PM in The Computer Give a Dialog Box And tell "The time is 10:00PM Go and sleep"

Can any body help
Visual Basic!!

推荐答案

它不是那样工作的:您尝试完成任务,陷入困境,在这里询问.我们会回答并帮助您解决问题(并希望在此过程中学到一些东西-您和我们都非常频繁).

相反,我将为您提供一些适合使用WinForms VB应用程序执行此操作的想法:

在窗体中添加一个Timer,并将Interval属性设置为10秒(这是一个10000,单位是毫秒).
为Tick事件添加处理程序.
在处理程序中,获取当前时间(使用DateTime.Now),并分别检查小时和分钟的22和0.
如果它们都匹配,请使用MessageBox.Show方法显示您的消息.

通过在搜索字符串的末尾添加"MSDN",可以通过搜索名称来查找所有这些项目的信息以及如何使用它们.

如果对此有疑问,请随时回来询问,但请先尝试一下.仅仅要求提供代码是一个坏主意,因为它使我们认为您太懒了,自己做不到! :laugh:
It doesn''t quite work like that: you try to do the task, you get stuck, you ask here. We answer and help you to fix your problem (and hopefully learn something in the process - you and us quite frequently).

Instead, I''ll give you a couple of ideas suitable for doing this with a WinForms VB application:

Add a Timer to your form, and set the Interval property to 10 seconds (this is a value of 10000 as it is in milliseconds).
Add a handler for the Tick event.
In the handler, get the current time (using DateTime.Now) and check it''s hour and minute for 22 and 0 respectively.
If they both match, use the MessageBox.Show method to display your message.

You can find information on all of these items, and how to use them, by googling for the name, with "MSDN" added on the end of the search string.

If you get a problem with this, please feel free to come back and ask about it, but do try yourself first. Just asking for the code is a bad idea as it makes us think you are too lazy to do it yourself! :laugh:


访问一些有用的链接

[
visit some useful links

[^]

[^]

Happy Coding!
:)


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

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