• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 298
  • Last Modified:

Digital Post-It note

What I want to do is create a small program with a text box in the middle. After a type something in the text box I want to add it to a text file. I have something set up now but the way it works it replaces the previous text. I want to use the program as a Digital Post-It note to alleviate the millions of post it notes on my desk. Along with adding the text to a text file I want it to mark each addition with the date and time it was added. I also want to be able to change the font of the text. The way I have it working now it changes the font of the entire text box. Is there a way I can only change the font of the text which is highlighted in the text box. Thanks for the help.

Rocket8411
0
Rocket8411
Asked:
Rocket8411
  • 2
  • 2
1 Solution
 
HermeticCommented:
Going from memory.
Use a RichText control.  It has members to select text and format only the selected text.  If I remember right, it also has a method for loading/saving to a file.
0
 
Rocket8411Author Commented:
here's the code I have now

Dim SaveToNotes As String
Dim EntryNum As Integer

Private Sub btnClear_Click()
txtNotes.ForeColor = &H0&
txtNotes.Text = ""
End Sub

Private Sub FleExit_Click()
Unload Me
End Sub

Private Sub FleSaveToNotes_Click()
Dim Day As VbDayOfWeek
Day = vbUseSystemDayOfWeek
EntryNum = EntryNum + 1
DateyTime = vbGeneralDate
SaveToNotes = "BeckPad Saved_Notes.txt"
Open SaveToNotes For Output As #1
Print #1, EntryNum
Print #1, Day
Print #1, txtNotes.Text
Close #1
End Sub

Private Sub fmtFont_Click()
frmFont.Show
End Sub
0
 
robertleesCommented:
Hermetic is right - you will have to use a rich text box to change the font and colour etc of parts of your text. You will also have to have some strategy of naming your file differently - for example you could use the current date/time...

strFileName = app.path & "\Note" & format(now,"ddmmmyyyhhmmss")
open strFileName for output as #1

Then you would need some strategy for getting them to popup on your screen at a due date/time - have you got that covered, or do you need more help.
0
 
Rocket8411Author Commented:
Well, Ive been working on it and I have a basic .exe consisting of multiple forms and I have it set up so the user, upon saving, saves the rich text box as a .rtf with a name having to configure to a mmddyy format. Now that is finished I'm going to figure out a way, upon the original form load, for the program to search a predetermined folder for a file matching the current mmddyy. I think I can figure that part out I just incountered something I'm worried about. I compiled the piece of my program I have now and realize when i terminate the exe with the x buttong in the upper right hand corner of the window the program remains in my memory. When I ctrl+alt+del I still see it running. I've made other program and I have not had this problem. Since this consists of multiple forms is there a method a need to use to make the program completly Unload. I even made a button on the first form with an Unload command, not an exit command. That did the same thing. I'll give the points to anyone who can answer this question.

Thanks
0
 
robertleesCommented:
In the Form_QueryUnload event you can do whatever code is necessary before the program dies when the user clicks the X. So in this event you can make sure all your forms are unloaded.


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Unload frmOne
    Unload frmTwo
    Unload frmThree
End Sub

Note that you don't issue an End statement here - the program has already decided to end, although you can stop it from ending by setting Cancel to True.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now