|
-
Nov 1st, 2007, 08:26 AM
#1
Thread Starter
New Member
[RESOLVED] Clock VB 2005
Hi everybody i need a clock that is in time with the system clock but has hours minutes and seconds and are in separate textboxes. can anyone help me out with the code?
-
Nov 1st, 2007, 09:03 AM
#2
Re: Clock VB 2005
Welcome to the forums. 
Try
vb.net Code:
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TextBox1.Text = DateTime.Now.Hour.ToString
TextBox2.Text = DateTime.Now.Minute.ToString
TextBox3.Text = DateTime.Now.Second.ToString
End Sub
-
Nov 1st, 2007, 09:14 AM
#3
Re: Clock VB 2005
Ixnay on the meworkhonay Hack.
-
Nov 1st, 2007, 12:05 PM
#4
Re: Clock VB 2005
 Originally Posted by sevenhalo
Ixnay on the meworkhonay Hack. 
Dont forget to dtop a timer control on to your form and name it Timer1 for the posted code to work
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 1st, 2007, 12:14 PM
#5
Re: Clock VB 2005
RobDog888: Your PM box is full
-
Nov 1st, 2007, 12:19 PM
#6
Re: Clock VB 2005
As usual I'll go through it in a bit, in the middle of work and need to make a call.
Back on topic.
Forgot to mention that you will also need to set the .Interval property of the timer so it will update your time display in the textbox to keep in sync with the system time. Set it to 500 or such so it will not place too much of a resource drain and yet stay within a reasonable tolerance of accuracy.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 1st, 2007, 02:24 PM
#7
Thread Starter
New Member
-
Nov 1st, 2007, 02:28 PM
#8
Thread Starter
New Member
Re: Clock VB 2005
cheers i just tested it and it works fine
-
Nov 1st, 2007, 03:28 PM
#9
Re: Clock VB 2005
Ok, then also as a new member I'll tell you that we like to Resolve our threads once they are solved so other members now your question has been answered. You can go to the Thread Tools menu and select Mark thread as Resolved.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 1st, 2007, 03:36 PM
#10
Fanatic Member
-
Nov 1st, 2007, 04:06 PM
#11
Re: Clock VB 2005
I dont see where he states its homework?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|