|
-
Jun 14th, 2012, 09:43 AM
#1
Sticky Notes for XP
I use windows vista at home and I use those little sticky notes all the time! At work I have xp and the sticky notes didn't come with xp. So I decided to make them for Window's XP. This was developed in Visual Basic Express 2010 targeting the .net framework 4.0
Features:
-Add multiple notes
-Right Click Menu Includes:
A. Clear Text
B. Edit Text
C. Save Text
D. Pin to desktop
Drawbacks:
-The pin to desktop is a little funny. If you pin to desktop while it's ontop of another program then you have to minimize every program for the sticky to stay at the desktop.
-If you add multiple stickys at once, I can see where it would take up some memory.
Plans - As of right now, I don't have any plans to fix the pin to desktop. Simply because I wanted the program to be as basic as possible, without including any API's.
Notes - I wanted to point out that this isn't just for window's xp, it would work fine with vista and I'm sure 7, however the reason I developed this was because I wanted something for xp. Also, the borders in vista makes the note look a little wierd.
ScreenShot:
Sticky Notes.zip
Source:
Code:
Option Strict On
Option Explicit On
Public Class Form1
Private pt As New Point
Private saved As Boolean = False
#Region "Moves a bordless Form"
Private Sub Panel1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
If saved = False Then
Dim delta As New Size(e.X - pt.X, e.Y - pt.Y)
If (e.Button = MouseButtons.Left) Then
Me.Location += delta : pt = e.Location - delta
Else
pt = e.Location
End If
End If
End Sub
#End Region
#Region "Control Events"
Private Sub lblAdd_Click(sender As Object, e As System.EventArgs) Handles lblAdd.Click
'Adds a new sticky
Dim form As New Form1
.form.Show()
.form.Focus()
End Sub
Private Sub lblClose_Click(sender As System.Object, e As System.EventArgs) Handles lblClose.Click
'Closes the Form
.Me.Close()
End Sub
#End Region
#Region "Context Menustrip"
Private Sub ClearTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ClearTextToolStripMenuItem.Click
'Clears Text
.txtBox.Text = String.Empty
If txtBox.ReadOnly = True Then
.txtBox.ReadOnly = False
End If
End Sub
Private Sub SaveTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SaveTextToolStripMenuItem.Click
'Makes the textbox readonly
.txtBox.ReadOnly = True : EditTextToolStripMenuItem.Enabled = True : SaveTextToolStripMenuItem.Enabled = False
End Sub
Private Sub EditTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EditTextToolStripMenuItem.Click
'Makes the textbox editable
.txtBox.ReadOnly = False : EditTextToolStripMenuItem.Enabled = False : SaveTextToolStripMenuItem.Enabled = True
End Sub
Private Sub PinToDesktopToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PinToDesktopToolStripMenuItem.Click
'Pins the program
If saved = False Then
.saved = True : PinToDesktopToolStripMenuItem.Checked = True : lblClose.Visible = False : Me.ShowInTaskbar = False
.SetParent(Me.Handle, FindWindow("ProgMan", Nothing))
.Me.SendToBack()
Else
.saved = False : PinToDesktopToolStripMenuItem.Checked = False : lblClose.Visible = True : Me.ShowInTaskbar = True
End If
End Sub
#End Region
End Class
Last edited by dday9; Feb 27th, 2013 at 12:03 PM.
-
Jun 14th, 2012, 10:28 AM
#2
Re: Sticky Notes for XP
I ran into a similar problem when I started writing my own Sticky Notes app (I call mine Reminder Notes).
I wanted a way to have the Note windows be part of the desktop (to avoid being minimized when the 'Minimize to Desktop' command was issued) as well as having the note's be able to be semi-transparent (like the Win7 gadgets can be). I never did find a good solution.
Your note's app here looks to be like it's off to a good start, if you're wanting any pointers feel free to ask. For your "borders" problem, just draw the note in the form's paint event on a borderless form. For the moving and resizing, you'll need to handle the MouseDown event, figure out where the mouse is to know if it's a resize or a move or neither, set a flag variable and in the MouseMove event move the form. In the MouseUp event you'll want to clear those variables.
I created mine to mimic the Windows 7 Sticky Notes app, but mine works on XP and newer and runs from the system tray (the win7 one has an icon on the taskbar instead and the Vista one is, well, really crappy).
Last edited by JuggaloBrotha; Jun 14th, 2012 at 10:34 AM.
-
Jun 14th, 2012, 10:34 AM
#3
Re: Sticky Notes for XP
Yeah sure, I'm all ways up for pointers. If y'all find something that can help the program out lemme know :]
-
Jun 14th, 2012, 10:54 AM
#4
Re: Sticky Notes for XP
interesting post. i wrote an XP sticky notes app a couple of years ago.
i made some improvements to your code:
vb Code:
Option Strict On
Option Explicit On
Public Class Form1
''' <summary>
''' This program was created by David Day to be very simple to use for Window's XP users
''' </summary>
''' <remarks>
''' As of right now the pin to desktop is a little funky
''' That could be fixed by using some API's.
''' </remarks>
Private pt As New Point
Private saved As Boolean = False
Declare Function SetParent Lib "user32.dll" Alias "SetParent" (ByVal hWndChild As IntPtr, ByVal hWndNewParent As IntPtr) As IntPtr
Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
#Region "Moves a bordless Form"
Public Const HT_CAPTION As Integer = &H2
Public Const WM_NCLBUTTONDOWN As Integer = &HA1
Private Sub Panel1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel1.MouseMove
'If saved = False Then
' Dim delta As New Size(e.X - pt.X, e.Y - pt.Y)
' If (e.Button = MouseButtons.Left) Then
' Me.Location += delta : pt = e.Location - delta
' Else
' pt = e.Location
' End If
'End If
If e.Button = Windows.Forms.MouseButtons.Left Then
DirectCast(sender, Control).Capture = False
Me.WndProc(Message.Create(Me.Handle, WM_NCLBUTTONDOWN, CType(HT_CAPTION, IntPtr), IntPtr.Zero))
End If
End Sub
#End Region
#Region "Control Events"
Private Sub lblAdd_Click(sender As Object, e As System.EventArgs) Handles lblAdd.Click
'Adds a new sticky
Dim form As New Form1
form.Show()
form.Focus()
End Sub
Private Sub lblClose_Click(sender As System.Object, e As System.EventArgs) Handles lblClose.Click
'Closes the Form
Me.Close()
End Sub
#End Region
#Region "Context Menustrip"
Private Sub ClearTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ClearTextToolStripMenuItem.Click
'Clears Text
txtBox.Text = String.Empty
If txtBox.ReadOnly = True Then
txtBox.ReadOnly = False
End If
End Sub
Private Sub SaveTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SaveTextToolStripMenuItem.Click
'Makes the textbox readonly
txtBox.ReadOnly = True : EditTextToolStripMenuItem.Enabled = True : SaveTextToolStripMenuItem.Enabled = False
End Sub
Private Sub EditTextToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles EditTextToolStripMenuItem.Click
'Makes the textbox editable
txtBox.ReadOnly = False : EditTextToolStripMenuItem.Enabled = False : SaveTextToolStripMenuItem.Enabled = True
End Sub
Private Sub PinToDesktopToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles PinToDesktopToolStripMenuItem.Click
'Pins the program
If saved = False Then
saved = True : PinToDesktopToolStripMenuItem.Checked = True : lblClose.Visible = False : Me.ShowInTaskbar = False
SetParent(Me.Handle, FindWindow("ProgMan", Nothing))
Me.SendToBack()
Else
saved = False : PinToDesktopToolStripMenuItem.Checked = False : lblClose.Visible = True : Me.ShowInTaskbar = True
End If
End Sub
#End Region
End Class
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 14th, 2012, 11:49 AM
#5
Re: Sticky Notes for XP
I glad to see your response. I've never done any work with api's so this is something that I wanna test. Thank you :]
-
Sep 20th, 2012, 03:45 PM
#6
Re: Sticky Notes for XP
Update
I fixed the 'pin to desktop' feature as well as added multiple colors! Here is a screen shot of in Windows 7.
Attachment 91573
Here is the updated file:
-
Sep 20th, 2012, 09:13 PM
#7
Re: Sticky Notes for XP
You should consider making the note windows borderless. It would give them a cleaner look.
-
Nov 26th, 2012, 11:10 AM
#8
Lively Member
Re: Sticky Notes for XP
i downloaded above link ,how to install in xp
-
Nov 26th, 2012, 11:17 AM
#9
Re: Sticky Notes for XP
To debug the sticky notes:
- Click on Sticky Notes.Zip in post #6
- Save to your desktop(or any folder will do)
- Open Visual Studios
- Click File - Open - Open Project
- Open sticky notes
- Debug(Press F5) the program
To publish the sticky notes, follow the publishing instructions you would do for any other project.
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
|