Click here to Skip to main content
16,008,299 members
Home / Discussions / C#
   

C#

 
GeneralRe: imagelist problem Pin
Heath Stewart27-Dec-04 20:47
protectorHeath Stewart27-Dec-04 20:47 
Generaldilema with strings and richtextbox Pin
Tyrus18227-Dec-04 16:46
Tyrus18227-Dec-04 16:46 
GeneralRe: dilema with strings and richtextbox Pin
Heath Stewart27-Dec-04 20:34
protectorHeath Stewart27-Dec-04 20:34 
GeneralRe: dilema with strings and richtextbox Pin
Tyrus18228-Dec-04 8:39
Tyrus18228-Dec-04 8:39 
GeneralRe: dilema with strings and richtextbox Pin
Heath Stewart28-Dec-04 9:59
protectorHeath Stewart28-Dec-04 9:59 
GeneralRe: dilema with strings and richtextbox Pin
Tyrus18228-Dec-04 12:09
Tyrus18228-Dec-04 12:09 
GeneralRe: dilema with strings and richtextbox Pin
Heath Stewart28-Dec-04 12:16
protectorHeath Stewart28-Dec-04 12:16 
GeneralRe: dilema with strings and richtextbox Pin
Tyrus18228-Dec-04 12:26
Tyrus18228-Dec-04 12:26 
i tried the stringbuilder and got the same results

public override string Text
{
get
{
return base.Text;
}
set
{
ColorAnsiString(value);
}
}

public void ColorAnsiString(string s)
{
StringBuilder str = new StringBuilder(s.Length);
Color col = colors[(int)ColorCodes.BLACK].Col;
int i = 0, x = 0, y = 0, n = 0;

for(i = 0; i < s.Length; i++)
{
if(i > s.Length || i+1 > s.Length)
break;

if(s[i] == '&')
{
if(i+1 < s.Length)
{
if(s[i+1] == '+')
{
for(x = 0; x< (int)ColorCodes.MAX; x++)
{
if(s[i+2] == colors[x].Key)
{
col = colors[x].Col;
break;
}
}
}
}

for(n = 0, y = i+3; y < s.Length; y++, n++)
{

str.Append(s[y]);

if(s[y] == '&' || s[y] == '\0' || s[y] == '\n' || s[y] == '\r')
{
//str += '\r';
base.Text = str;
//this.Select(base.Text.Length-str.Length, base.Text.Length);
// SelectionColor = col;
// i+=str.Length;
//
// col = colors[(int)ColorCodes.WHITE].Col;

return;
}
}
}
}
}

if you replace base.Text with s it works when its str it doesnt
GeneralRe: dilema with strings and richtextbox Pin
Heath Stewart28-Dec-04 12:34
protectorHeath Stewart28-Dec-04 12:34 
GeneralRe: dilema with strings and richtextbox Pin
Tyrus18228-Dec-04 12:50
Tyrus18228-Dec-04 12:50 
GeneralRe: dilema with strings and richtextbox Pin
Tyrus18228-Dec-04 13:00
Tyrus18228-Dec-04 13:00 
GeneralperformanceCounter woes Pin
sween327-Dec-04 16:38
sween327-Dec-04 16:38 
GeneralDBAdapter.Fill(), datatype matching. Pin
zecodela27-Dec-04 15:45
zecodela27-Dec-04 15:45 
GeneralRe: DBAdapter.Fill(), datatype matching. Pin
sreejith ss nair27-Dec-04 18:37
sreejith ss nair27-Dec-04 18:37 
GeneralRe: DBAdapter.Fill(), datatype matching. Pin
Heath Stewart27-Dec-04 20:12
protectorHeath Stewart27-Dec-04 20:12 
GeneralRe: DBAdapter.Fill(), datatype matching. Pin
Heath Stewart27-Dec-04 20:20
protectorHeath Stewart27-Dec-04 20:20 
GeneralContainer Window for Minimized forms Pin
hybrid7927-Dec-04 14:25
hybrid7927-Dec-04 14:25 
GeneralRe: Container Window for Minimized forms Pin
Heath Stewart27-Dec-04 20:10
protectorHeath Stewart27-Dec-04 20:10 
QuestionHow to assosiate files to my program Pin
mikker_12327-Dec-04 12:00
mikker_12327-Dec-04 12:00 
AnswerRe: How to assosiate files to my program Pin
Heath Stewart27-Dec-04 20:01
protectorHeath Stewart27-Dec-04 20:01 
QuestionImageList SizeMode ? Pin
geestje27-Dec-04 11:21
geestje27-Dec-04 11:21 
AnswerRe: ImageList SizeMode ? Pin
Heath Stewart27-Dec-04 19:58
protectorHeath Stewart27-Dec-04 19:58 
GeneralRe: ImageList SizeMode ? Pin
geestje28-Dec-04 7:07
geestje28-Dec-04 7:07 
GeneralRe: ImageList SizeMode ? Pin
Heath Stewart28-Dec-04 7:11
protectorHeath Stewart28-Dec-04 7:11 
GeneralRe: ImageList SizeMode ? Pin
geestje28-Dec-04 7:20
geestje28-Dec-04 7:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.