x10Hosting Forums

Corporate Free Hosting for the Masses.


x10Hosting wishes you a great Year!

Register

Closed Thread
 
LinkBack Thread Tools Display Modes
x10Hosting Member

Join Date: Oct 2007
Posts: 42
Credits: 550
victor12345 is on a distinguished road
 
01-21-2008, 07:29 PM
Talking Time Viewer Tutorial

How to make a time viewer in the icon tray:
I just designed it from scratch. I also know that I have alot of stuff I don\'t need!
1. Create The Design of the forms
1. Form1 (Only form to design)
You need the following objects
Form Settings
1. FormBorderStyle => None
Just Scatter the labels around, it doesn\'t matter the slightest!
1. Label1 - No purpose at the moment
2. Label2 - No purpose at the moment
3. Label3 ---=> Text => 00:00:00
4. Label4 -/
5. Label5 ---=> Text => Dec 1, 10001
6. Label6 -/
These have no location, so who cares about the location?
7. Timer1 => Interval => 1 | Enabled =>1
8. NotifyIcon1 => Visible => True | Icon MUST be set to anything, but it just has to be set to something!
For those lazy people, I am using Microsoft Visual Studio 2008 Beta 2, free for about 300 days. This is the content of Form1.Designer.vb :
==================================Start Code==================================
<Global.Microsoft.VisualBasic.CompilerServices.Des ignerGenerated()> _
Partial Class Form1
Inherits System.Windows.Forms.Form
\'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
\'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
\'NOTE: The following procedure is required by the Windows Form Designer
\'It can be modified using the Windows Form Designer.
\'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(Get Type(Form1))
Me.Label1 = New System.Windows.Forms.Label
Me.Label2 = New System.Windows.Forms.Label
Me.Label3 = New System.Windows.Forms.Label
Me.Label4 = New System.Windows.Forms.Label
Me.Label5 = New System.Windows.Forms.Label
Me.Label6 = New System.Windows.Forms.Label
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.NotifyIcon1 = New System.Windows.Forms.NotifyIcon(Me.components)
Me.SuspendLayout()
\'
\'Label1
\'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(1, -2)
Me.Label1.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
Me.Label1.Name = \"Label1\"
Me.Label1.Size = New System.Drawing.Size(238, 36)
Me.Label1.TabIndex = 0
Me.Label1.Text = \"Calgary (GMT-7)\"
\'
\'Label2
\'
Me.Label2.AutoSize = True
Me.Label2.Font = New System.Drawing.Font(\"Microsoft Sans Serif\", 15.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.Location = New System.Drawing.Point(1, 34)
Me.Label2.Margin = New System.Windows.Forms.Padding(6, 0, 6, 0)
Me.Label2.Name = \"Label2\"
Me.Label2.Size = New System.Drawing.Size(234, 29)
Me.Label2.TabIndex = 1
Me.Label2.Text = \"Shenzhen (GMT+8)\"
\'
\'Label3
\'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(244, -2)
Me.Label3.Name = \"Label3\"
Me.Label3.Size = New System.Drawing.Size(133, 36)
Me.Label3.TabIndex = 2
Me.Label3.Text = \"00:00:00\"
\'
\'Label4
\'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(244, 34)
Me.Label4.Name = \"Label4\"
Me.Label4.Size = New System.Drawing.Size(133, 36)
Me.Label4.TabIndex = 3
Me.Label4.Text = \"00:00:00\"
\'
\'Label5
\'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(383, -2)
Me.Label5.Name = \"Label5\"
Me.Label5.Size = New System.Drawing.Size(193, 36)
Me.Label5.TabIndex = 4
Me.Label5.Text = \"Dec 1, 10001\"
\'
\'//------------------------------------------------------//\'
It\'s So long! See Next Post!
__________________
Please click here : or a button that looks like it...

If you clicked it, thanks!
If everyone just clicks one of that button on my post, once, I would be very happy!
victor12345 is offlineReport Post
x10Hosting Member

Join Date: Oct 2007
Posts: 42
Credits: 550
victor12345 is on a distinguished road
 
01-21-2008, 07:51 PM
Re: Time Viewer Tutorial

Here\'s The Continued Post
\'//-------------------------------------------//\'
\'Label6
\'
Me.Label6.AutoSize = True
Me.Label6.Location = New System.Drawing.Point(383, 34)
Me.Label6.Name = \"Label6\"
Me.Label6.Size = New System.Drawing.Size(193, 36)
Me.Label6.TabIndex = 5
Me.Label6.Text = \"Dec 1, 10001\"
\'
\'Timer1
\'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 1
\'
\'NotifyIcon1
\'
Me.NotifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info
Me.NotifyIcon1.BalloonTipText = \"Getting\"
Me.NotifyIcon1.BalloonTipTitle = \"The Times for Calgary and Shenzhen\"
Me.NotifyIcon1.Icon = CType(resources.GetObject(\"NotifyIcon1.Icon\"), System.Drawing.Icon)
Me.NotifyIcon1.Text = \"NotifyIcon1\"
Me.NotifyIcon1.Visible = True
\'
\'Form1
\'
Me.AutoScaleDimensions = New System.Drawing.SizeF(17.0!, 36.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(571, 72)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Font = New System.Drawing.Font(\"Microsoft Sans Serif\", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None
Me.Margin = New System.Windows.Forms.Padding(6, 7, 6, 7)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = \"Form1\"
Me.Opacity = 0.68
Me.Text = \"Time Viewer\"
Me.WindowState = System.Windows.Forms.FormWindowState.Minimized
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label6 As System.Windows.Forms.Label
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents NotifyIcon1 As System.Windows.Forms.NotifyIcon
End Class
==================================End Code==================================
2. Create Code
Just use the code I have:
==================================Start Code==================================
Public Class Form1
Declare Function Beep Lib \"kernel32.dll\" Alias \"Beep\" (ByVal freq As Integer, ByVal duration As Integer) As Boolean
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim calt As Date = Now
\'If Now.Millisecond = 0 Then Call Beep(1000, 15)
Dim szt As Date = Now.AddHours(15)
Label3.Text = tdf(calt.Hour) & \":\" & tdf(calt.Minute) & \":\" & tdf(calt.Second)
Label5.Text = GMN(calt.Month) & \" \" & tdf(calt.Day) & \", \" & tdf(calt.Year)
Label4.Text = tdf(szt.Hour) & \":\" & tdf(szt.Minute) & \":\" & tdf(szt.Second)
Label6.Text = GMN(szt.Month) & \" \" & tdf(szt.Day) & \", \" & tdf(szt.Year)
If calt.Millisecond = 0 Then
NotifyIcon1.BalloonTipText = \"Mountain Time (GMT - 7) \" & Label5.Text & \" \" & Label3.Text & Chr(13) & Chr(10) & \"China (GMT + 8) \" & Label6.Text & \" \" & Label4.Text
NotifyIcon1.ShowBalloonTip(100)
End If
End Sub
Function GMN(ByVal mnt As Integer) As String
Dim str As String
Select Case mnt
Case 1
\'str = \"Janurary\"
str = \"Jan\"
Case 2
\'str = \"Feburary\"
str = \"Feb\"
Case 3
\'str = \"March\"
str = \"Mar\"
Case 4
\'str = \"April\"
str = \"Apr\"
Case 5
\'str = \"May\"
Case 6
\'str = \"June\"
str = \"Jun\"
Case 7
\'str = \"July\"
str = \"Jul\"
Case 8
\'str = \"August\"
str = \"Aug\"
Case 9
\'str = \"September\"
str = \"Sep\"
Case 10
\'str = \"October\"
str = \"Oct\"
Case 11
\'str = \"November\"
str = \"Nov\"
Case 12
\'str = \"December\"
str = \"Dec\"
End Select
Return str
End Function
ReadOnly Property tdf(ByVal t As Integer) As String
Get
If t.ToString.Length = 1 Then Return \"0\" & t.ToString Else : Return t.ToString
End Get
End Property
Private Sub NotifyIcon1_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles NotifyIcon1.MouseDoubleClick
End
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Height = 0
Me.Width = 0
End Sub
End Class
==================================End Code==================================
3. Adjust to your needs:
1. Replace Mountain Time with your time zone, and GMT+/-* and replace China with any time zone, and GMT+/-*
2. Now you can start to replace AddHours(15) with AddHours(*)
3. The * is supposed to be difference between the two times!
4. Compile it
Just compile it, and take the .exe from the debugged directory!
4. Learn how to use it.
1. Double click on the application to start it up.
2. It will popup a balloon updating both time zone\'s time!
3. Double Click on the Icon to Close it.
4. If it doesn\'t close, just click it 4 times
5. Enjoy!

-----------------------------------------------------------------------------------------
Test Out My Attachment!
Edit:
doh! I forgot to add an attachment!
__________________
Please click here : or a button that looks like it...

If you clicked it, thanks!
If everyone just clicks one of that button on my post, once, I would be very happy!

Last edited by victor12345; 01-21-2008 at 07:51 PM. Reason: Automerged Doublepost
victor12345 is offlineReport Post
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cpanel down and my web site down. All the time mgiannel Free Hosting 3 12-23-2007 10:54 PM
{TUTORIAL} Page design / layout / template (NO slicing!) lambada Tutorials 2 12-16-2006 09:59 PM
Network Folder Sharing Tutorial TheJeffsta Computers & Technology 0 03-31-2006 03:33 AM
Time out prob elserge82 Free Hosting 6 11-29-2005 08:04 PM
Displaying Time & Date Through JavaScript/HTML DJL2K Tutorials 4 09-04-2005 04:27 AM


All times are GMT -5. The time now is 05:30 AM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios