You're thinking like a user in terms of what you want. You can't set the individual properties of a font, you'll have to create a new object with the properties that you need;
richTextBox1.SelectionFont = new Font(richTextBox1.Font,
richTextBox1.SelectionFont.Style ^ FontStyle.Bold);
It might be working exactly as the user expects as you're not changing a property, but creating a new object with the correct properties. Same goes for the other properties; if they're readonly, you'll probably have to replace the entire object.
Hello everyone, currently I am working on a project, in which I have save some text, and images on disk in encrypted format (means no other application except mine may be able to read). But I have never worked before on such project (means creating a new file extension for some special purpose, on data encryption). So I am bit confused about it.
So can U please help me in this respect, or point me towards some good tutorial which can help me.
There is nothing special about creating files in your own format, all you need is to include some meta data or other pointers to show the type and length of each record. So for example your file type contains text and images you would do something like:
Create new binary stream file
Write header information
Write text identifier record: flag 0, length L
Write L text characters
Repeat until all text is written
Write image identifier record: flag 1, length M
Write M bytes of the image data
Repeat until all image data is written
Repeat as required for other content
When reading back you just use the identifier records to rebuild your text or image blocks in memory and display or otherwise process them as required.
Create a folder, store all parts there in individual files. Then zip the folder, you may use a password for that. Change the extension to your own extension.
For opening the file, just reverse that process.
And do not forget to delete the folder after it was zipped, or after its contents were read.