Page 1 of 1

I need your help...!

Posted: Fri Jan 04, 2013 1:55 pm
by noypikami
database.JPG
please help me guys,,,! i just made a new database in VB. Its consist of a text editor to enable specific font and text editing before saving the data. its almost finish but there's something
that i cant figure out why i cant save the colors, font styles that i specified after editing on a richtext box.
the database only saves a normal textfile without specific fontstyles , fonsize on each word.
I hope you know what i mean,

please check this out.. may be there's someone who could help me...!
here's is the application i made.
http://www.mediafire.com/download.php?5fdw330uja28h6p

Re: I need your help...!

Posted: Fri Jan 04, 2013 2:30 pm
by comathi
When you save the file, use this code:
Code: Select all
RichTextBox1.SaveFile("filename",RichTextBoxStreamType.RichText)
This'll save the file in rich format, preserving the colors and fonts.

Re: I need your help...!

Posted: Fri Jan 04, 2013 2:42 pm
by noypikami
@comathi.

Thank you for a fast reply, your suggestion is right about saving the file back to your PC but this case is different
its a database where-in the file and the edited fonts and styles specifically
needs to be saved inside the database. the problem occurs after finally editing the file, likes changing its font styles,
size, bullets, highlights, colors then save it to database , where-in the saved file inside
the databse goes back to plain text w/o specific colors and styles.

Re: I need your help...!

Posted: Fri Jan 04, 2013 2:46 pm
by comathi
I don't think your database can contain rich text. However, you could always try saving HTML to the database. That way you could keep the correct formatting in a webbrowser and simply edit the code in a plain text editor.

EDIT:

I stand corrected, there is a way to achieve what you want to accomplish. When saving the file, do the following:
Code: Select all
Dim rtfStr As String=RichTextBox1.Rtf
'Now, here, you can insert rtfStr into your database
When it comes time to re-edit the file, you can do this:
Code: Select all
Dim rtfStr As String = 'Get the info from the database to your String
RichTextBox1.Rtf=rtfStr
Thanks to this link for getting me on the right track.

Re: I need your help...!

Posted: Sat Jan 05, 2013 3:19 am
by noypikami
Thanks, i will try your suggestions.... Im happy for your fast reply to my post.! wahooo;

Re: I need your help...!

Posted: Sat Jan 05, 2013 4:12 am
by Shim
you can add this things]
Code: Select all

        CursorPositionToolStripMenuItem.Text = "Cursor Position: " & RichTextBox1.SelectionStart
        CurrentLineToolStripMenuItem.Text = "Current Line: " & RichTextBox1.GetLineFromCharIndex(RichTextBox1.SelectionStart) + 1
        TotalCharactersToolStripMenuItem.Text = "Total Characters: " & RichTextBox1.TextLength
        ToolStripMenuItem2.Text = "     Total Lines: " & RichTextBox1.Lines.Length



i found them from my old html editor

Image