This program displays the current data (in what I believe is the British format - day.month.year), then a copyright symbol, and finally the name of the company holding the copyright in a messagebox that is displayed when the program is first started.
Here it is:
Code:
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Namespace Copyright
Public Class MainForm
Inherits System.Windows.Forms.Form
Private output As String = ""
Public Shared Sub Main
Dim fMainForm As New MainForm
fMainForm.ShowDialog()
End Sub
Public Sub New()
MyBase.New
'
' The Me.InitializeComponent call is required for Windows Forms designer support.
'
Me.InitializeComponent
Try
CreateCopyright()
DisplayCopyright()
Catch exc As Exception
MessageBox.Show(exc.ToString())
End Try
'
' TODO : Add constructor code after InitializeComponents
'
End Sub
Private Sub CreateCopyright()
Dim s As String = ""
Dim dt As DateTime = DateTime.Now
Dim mth As Integer = dt.Month
Dim dy As Integer = dt.Day
Dim yr As Integer = dt.Year
s &= CStr(dy) + "." + CStr(mth) + "." + CStr(yr) + " "
s &= Convert.ToChar(169).ToString()
s &= " Copyright Company Name"
's&= dt.ToString("MM/dd/yy")
output = s
End Sub
Private Sub DisplayCopyright()
MessageBox.Show(output, "Date time message", MessageBoxButtons.OK, MessageBoxIcon.Asterisk, MessageBoxDefaultButton.Button1)
End Sub
#Region " Windows Forms Designer generated code "
' This method is required for Windows Forms designer support.
' Do not change the method contents inside the source code editor. The Forms designer might
' not be able to load this method if it was changed manually.
Private Sub InitializeComponent()
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.Name = "MainForm"
Me.Text = "MainForm"
End Sub
#End Region
End Class
End Namespace
Copy, paste, compile, and run.
Please let me know if this helps or if it needs something else...
Bookmarks