|
-
May 26th, 2006, 06:26 AM
#1
Thread Starter
Junior Member
My Daily Quotations
Name of this Application: My Daily Quotations (not sure about the name yet)
Description: Simple program to Display daily quotations/proverbs, etc. entered to an Access database. User selects a date from a MonthCalendar control, if not today's text is displayed.
My Purpose:
The program, when closed from it close button [x], will go to system tray and remind the quotation of the day with a BalloonNotification based on user's preference. For this reason:
1. A preferences form should be added in order to define reminder's delay in minutes. When this form is closed it will save the input to a file, so the balloon will notify according to this setting.
2. A BalloonNotification control should be implemented: Should appear and disappear without user interaction. May disappear after displaying its contents after some seconds. (this can also be controlled from preferences form also).
3. Small Memory usage...
Perfection:
I'm hoping to include an online update feature which will download new/modified access file. Access is not a must, but I do not have any other idea for the time being for replacing it.
Can you help to improve this app? Thanks for your guidance...
Here is the code until now:....
VB Code:
Imports System
Imports System.Drawing
Imports System.Data.OleDb
Imports System.ComponentModel
Public Class Form1
Inherits System.Windows.Forms.Form
<System.STAThread()> _
Public Shared Sub Main()
'Enable XP Styles
System.Windows.Forms.Application.EnableVisualStyles()
System.Windows.Forms.Application.Run(New Form1)
End Sub
Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim Da As New OleDbDataAdapter
Dim DtTest As New DataTable("myEntries")
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=db.mdb;")
cmd = New OleDbCommand("select * from myEntries", cn)
Me.Da.SelectCommand = cmd
Da.Fill(Me.DtTest)
Catch Ex As OleDbException
MessageBox.Show(Ex.Message)
Finally
cn.Close()
End Try
ShowQuote()
End Sub
Private Sub ShowQuote()
Dim Matches As Integer = 0
For Each Dr As DataRow In Me.DtTest.Rows
If CDate(Dr.Item(0)) = CDate(MonthCalendar1.SelectionRange.Start.Date) Then
TextBox1.Text = """" + Convert.ToString(Dr.Item(2)) + """"
TextBox2.Text = Convert.ToString(Dr.Item(1))
Matches += 1
End If
Next
If Matches = -1 Then
MessageBox.Show("No Entries found for selected date! ")
End If
End Sub
Private Sub Form1_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
e.Cancel = True
Me.Hide()
MonthCalendar1.SetDate(Today)
'BalloonNotification will be used to display today’s quote
InitializeTimer()
End Sub
Private Sub InitializeTimer()
Timer1.Interval = 10000 'Value to be modified by user
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
'BalloonNotification will be displayed
End Sub
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
|