Click here to Skip to main content
15,901,373 members
Home / Discussions / C#
   

C#

 
QuestionDynamic value for new row in DataGrid Pin
AndrusM26-Dec-06 3:15
AndrusM26-Dec-06 3:15 
AnswerRe: Dynamic value for new row in DataGrid Pin
Nader Elshehabi26-Dec-06 8:02
Nader Elshehabi26-Dec-06 8:02 
GeneralRe: Dynamic value for new row in DataGrid Pin
AndrusM27-Dec-06 0:11
AndrusM27-Dec-06 0:11 
GeneralRe: Dynamic value for new row in DataGrid Pin
Nader Elshehabi27-Dec-06 3:52
Nader Elshehabi27-Dec-06 3:52 
GeneralRe: Dynamic value for new row in DataGrid Pin
AndrusM27-Dec-06 4:06
AndrusM27-Dec-06 4:06 
GeneralRe: Dynamic value for new row in DataGrid Pin
Nader Elshehabi27-Dec-06 5:39
Nader Elshehabi27-Dec-06 5:39 
QuestionHow to handle mouse move in combobox Pin
prabhakaranns26-Dec-06 3:14
prabhakaranns26-Dec-06 3:14 
QuestionText Coloring in richTextBox Pin
Moham'd26-Dec-06 0:47
Moham'd26-Dec-06 0:47 
Hi,

My question is very simple. I'm working on ftp client. Its function is clear, just connecting to the ftp server, send a ftp command and receieve a response from the server. Both the result of sending commands and receiving the response are shownn in the richTextBox. What i aimed to do is to make the text color of the sending command is deffirnt from the received response (in richTextBox)

For example,

command: help ===> appearse in the richTextBox as help(in blue color)
response:
ABOR
ACCT
ALLO
APPE
CDUP
CWD
DELE
HELP
LIST
MDTM
MKD
MODE
NLST
NOOP
PASS
PASV
PORT
PWD
===> appearse in the richTextBox in Red color

I tried this code for coloring, but it is coloring the whole text in the richTextBox

the code is

private void sendBtn_Click(object sender, EventArgs e)
{

String[] array = new String[3];

array[0] = bodyTxt.Text;
array[1] = cmndTxt.Text;

bodyTxt.Text = "";


richTextBox.AppendText(array[1] + "\r\n");

// Coloring
richTextBox.SelectionStart = 0;
richTextBox.SelectionLength = cmndTxt.Text.Length;
richTextBox.ForeColor = Color.DarkRed;

writer.WriteLine(cmndTxt.Text);
writer.Flush();

ReadResponse(); //read response from the server


bodyTxt.AppendText(array[0] + "\r\n");

}

for clearification:- cmndTxt.Text is the command the i want to send to the ftp server.
richTextBox is the textBox that recieves the response-from the server-
and the command -from the user.

what should be the modifications for my code?.


Many thanks in advance Smile | :)
AnswerRe: Text Coloring in richTextBox Pin
Kishore Ramakrishnan26-Dec-06 1:50
Kishore Ramakrishnan26-Dec-06 1:50 
GeneralRe: Text Coloring in richTextBox Pin
Moham'd26-Dec-06 8:05
Moham'd26-Dec-06 8:05 
Questionget 50 files from directory . Pin
justintimberlake26-Dec-06 0:43
justintimberlake26-Dec-06 0:43 
Questionhow to configure my iis to send email from my Asp.net website (in my iis) ? Pin
hdv21226-Dec-06 0:37
hdv21226-Dec-06 0:37 
AnswerRe: how to configure my iis to send email from my Asp.net website (in my iis) ? Pin
Muammar©26-Dec-06 3:43
Muammar©26-Dec-06 3:43 
QuestionDrag drop [toolbar]toolstrip onto form from its container Pin
GunaChinna25-Dec-06 23:59
GunaChinna25-Dec-06 23:59 
QuestionHow or is it possible...?? Pin
Besinci25-Dec-06 23:58
Besinci25-Dec-06 23:58 
AnswerRe: How or is it possible...?? Pin
Nader Elshehabi26-Dec-06 7:55
Nader Elshehabi26-Dec-06 7:55 
GeneralRe: How or is it possible...?? Pin
Besinci26-Dec-06 8:36
Besinci26-Dec-06 8:36 
GeneralRe: How or is it possible...?? Pin
Nader Elshehabi26-Dec-06 18:24
Nader Elshehabi26-Dec-06 18:24 
QuestionSearch in TreeView control Pin
Maddie from Dartford25-Dec-06 22:37
Maddie from Dartford25-Dec-06 22:37 
QuestionStyled ScrollBar [modified] Pin
MHASSANF25-Dec-06 21:47
MHASSANF25-Dec-06 21:47 
Question(Modify)Error while Displying the Report using Command SQL (Modify) Pin
jaganil25-Dec-06 20:35
jaganil25-Dec-06 20:35 
QuestionError while Displying the Report using Command SQL Pin
jaganil25-Dec-06 20:34
jaganil25-Dec-06 20:34 
QuestionError while Displying the Report using Command SQL Pin
jaganil25-Dec-06 20:32
jaganil25-Dec-06 20:32 
QuestionOpening the folder of a file Pin
kkadir25-Dec-06 20:25
kkadir25-Dec-06 20:25 
AnswerRe: Opening the folder of a file Pin
mav.northwind25-Dec-06 20:42
mav.northwind25-Dec-06 20:42 

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.