CODE
/*Comment gfhfghfg*/
Condition _Condition1u : BuddyComesOnline
{
BotGroup == "_ssi";
BuddyName == "*";
StatusType == "Idle";
ForSeconds == "60";
}
/*Comment asdasd*/
Effect _Effect1 : MessageBox
{
Title = "Pika Bot";
Message = "sdfsfsfsf";
Icon = "Asterisk";
}
/*ghjgj*/
Integer _Variable1 = "0";
/*asdas*/
Trigger _Trigger1 : ON
{
Conditions
{
_Condition1u;
}
Effects
{
_Effect1;
}
}
Bot _Bot2
{
ID = "asdasd";
Password = "τΟ";
Encrypt = "True";
}
/*asdasdas*/
Bot _Bot1
{
ID = "sdasd";
Password = "asdasda";
Encrypt = "False";
}
/*asdasda*/
BotGroup _BotGroup1
{
_Bot2
}
BotGroup _ssi
{
_Bot1
}
Condition _Condition1u : BuddyComesOnline
{
BotGroup == "_ssi";
BuddyName == "*";
StatusType == "Idle";
ForSeconds == "60";
}
/*Comment asdasd*/
Effect _Effect1 : MessageBox
{
Title = "Pika Bot";
Message = "sdfsfsfsf";
Icon = "Asterisk";
}
/*ghjgj*/
Integer _Variable1 = "0";
/*asdas*/
Trigger _Trigger1 : ON
{
Conditions
{
_Condition1u;
}
Effects
{
_Effect1;
}
}
Bot _Bot2
{
ID = "asdasd";
Password = "τΟ";
Encrypt = "True";
}
/*asdasdas*/
Bot _Bot1
{
ID = "sdasd";
Password = "asdasda";
Encrypt = "False";
}
/*asdasda*/
BotGroup _BotGroup1
{
_Bot2
}
BotGroup _ssi
{
_Bot1
}
The syntax highligher does some basic coloring of the keywords namely: Condition, Effect, Integer, String, Trigger, Bot and BotGroup, string constants, comments and Condition/Effect Types such as BuddyComesOnline and MessageBox. I learnt that there are two ways to go about doing this. One is to use the SelectionStart, SelectionLength, SelectionColor properties provided by the RichTextBox control and second to modify the RTF code directly. The first process is rather slow and is marred by flickers, so I chose the second option. Even though its much faster there is one problem that I can't get through. Loading the entire RTF code causes the scroll position to be modified. The control only provides the ScrollToCaret() method which I am unable to use to restore the previous scroll position.
Is there any way to make a RichTextBox control scroll to a specific position?
I have attached the sample application which does the highlighting. It requires .NET Framework 2.0 or higher.

