1
Answer

Read, edit and write RTF files

Egbert

Egbert

16y
11.4k
1
Hi,
I like to use the RichInk or a simular control to read, edit and write existing RTF files.
 
Tried a few commercial controls like the one from www.dsrtech.com, but can't reach them by email (don't exist anymore??), http://www.spellbuddy.com/SukiRichInk/SukiRichInk.asp but no repsonses to emails.
 
Tried using the RichInk control from www.opennetcf.com, but can not find good examples for VS2005 and C# (there is only older stuff available).
 
Is there some controls and sample code (C# with VS2005) which I can use which shows me a little bit more about RichText control and the stuff I like to do.
For editting, I only like to change font color, size and type (bold, italic).
 
Thanks and best regards,
Egbert
Answers (1)
0
Sandeep Singh Shekhawat

Sandeep Singh Shekhawat

NA 22.4k 12m 12y
inilization properties according to object like:

tramp.DogColour = "Blue";

and after that display data.
0
Jackson Eatherden

Jackson Eatherden

NA 3 1.4k 12y
Hi sandeep

Thanks for the response.
I did the code you suggested and was told by my teacher that i have to make a new instace of the dog class (this will become clear when i put the text up) calling the constructor that i create for size.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloDogs
{
    class Dog
    {
        private string barkSound;
        private string breed;
        private int dogHeight;
        private string dogColour;
        static int noOfLegs = 4;

        public static int NoOfLegs
        {
            get { return Dog.noOfLegs; }
            set { Dog.noOfLegs = value; }
        }

        public string DogColour
        {
            get { return dogColour; }
            set { dogColour = value; }
        }
        

        public string Breed
        {
            get { return breed; }
            set { breed = value; }
        }

        private string dogSpeech;
        
        public int Height
        {
            get { return dogHeight; }
            set { dogHeight = value; }
        }

        

        public Dog (int dh, string dc,string b)
        {
            dogHeight= dh;
            dogColour= dc;
            breed= b;
        }
        
        private bool IsBig (int height)
        {
            if (height >=50)
                return (true);
            else
                return (false);
        }

        public Dog()
        {
            barkSound = "Woof!";
            breed = "cocker spaniel";          
        }

        public string GetSpeech()
        {
            string size;
            if (IsBig(dogHeight))
            {
                size = "big";
            }
            else
            {
                size = "small";
            }

            dogSpeech = "Hello. I am a " + breed + ". " + barkSound + " my height is " + dogHeight+" therefore i am " + size;
            return dogSpeech;
            
            
        }
        public void SetSound(String barkSound)
        {
            this.barkSound = barkSound;
        } 

    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HelloDogs
{
    class DogChorus
    {
        Dog lady;        
        Dog tramp;
        Dog c;
        Dog d;
        
        public DogChorus() {
            lady = new Dog();        
            tramp = new Dog();
            c = new Dog();
            d = new Dog();
            tramp.SetSound("Ruff!");
        }

        public string GetOutput(){
            return lady.GetSpeech() + " \n " + tramp.GetSpeech() + "\n" + c.GetSpeech() + "\n" + d.GetSpeech() + "\n" + " All dogs have " + Dog.NoOfLegs + " legs";
        }
    }
}
I hope this helps


0
Sandeep Singh Shekhawat

Sandeep Singh Shekhawat

NA 22.4k 12m 12y
Can you please give code sample?

OR 

You can do it using Text property of these control under button click event...

Like:

txtrich.Text = txtFirst.Text + " "+ txtSecond.Text + "   " +txtThird.Text +"  "+ txtFour.Text;


Thanks
Sandeep