?
Solved

Digital Post-It note

Posted on 2003-03-15
5
Medium Priority
?
297 Views
Last Modified: 2010-05-01
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
Comment
Question by:Rocket8411
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 1

Expert Comment

by:Hermetic
ID: 8144099
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
 

Author Comment

by:Rocket8411
ID: 8144196
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
 
LVL 1

Expert Comment

by:robertlees
ID: 8144465
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
 

Author Comment

by:Rocket8411
ID: 8228078
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
 
LVL 1

Accepted Solution

by:
robertlees earned 300 total points
ID: 8228965
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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question