How to Display required text in richtextbox...
-
Hi... In my application i am receiveing some text on serialPort but i dont want to display all the received text. e.g. My received text is " Current Time : 08 NOV 2006" so i just want to display... "08 NOV 2006" in a textbox with my application. In serialport communiation i have to use SerialPort.ReadExisting(); & because of this i am getting text(" Current Time : 08 NOV 2006") in DataReceived Event as " Cu" , "rrent", "Tim", "e : 08"... I want to say i'm receiving my text in parts. My applcation should remove " Current Time : " & it should display only time in a textbox. Can anybody give me any suggestions to implement this in my application... Thanks in adavance, Vinay
-
Hi... In my application i am receiveing some text on serialPort but i dont want to display all the received text. e.g. My received text is " Current Time : 08 NOV 2006" so i just want to display... "08 NOV 2006" in a textbox with my application. In serialport communiation i have to use SerialPort.ReadExisting(); & because of this i am getting text(" Current Time : 08 NOV 2006") in DataReceived Event as " Cu" , "rrent", "Tim", "e : 08"... I want to say i'm receiving my text in parts. My applcation should remove " Current Time : " & it should display only time in a textbox. Can anybody give me any suggestions to implement this in my application... Thanks in adavance, Vinay
Hi, youc an have the result in a string variable and then replace 'Current Time :' with empty string. like if strTime is the string containinf "Current Time : 08 NOV 2006" then
strTime = strTime.Replace("Current Time :", "");
MubashirEvery job is a self portrait of the person who did it.
-
Hi... In my application i am receiveing some text on serialPort but i dont want to display all the received text. e.g. My received text is " Current Time : 08 NOV 2006" so i just want to display... "08 NOV 2006" in a textbox with my application. In serialport communiation i have to use SerialPort.ReadExisting(); & because of this i am getting text(" Current Time : 08 NOV 2006") in DataReceived Event as " Cu" , "rrent", "Tim", "e : 08"... I want to say i'm receiving my text in parts. My applcation should remove " Current Time : " & it should display only time in a textbox. Can anybody give me any suggestions to implement this in my application... Thanks in adavance, Vinay
store the incoming text in a string and then you can use the split method of string to split it by ':'. this way you will be able to get two strings of that time. So you can easily display the time and not the text. regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.
-
store the incoming text in a string and then you can use the split method of string to split it by ':'. this way you will be able to get two strings of that time. So you can easily display the time and not the text. regards
sAqIb "Our scientific power has outrun our spiritual power. We have guided missiles and misguided men." Dr. Martin Luther King Jr.
Thanks... can you help me for one more thing... If i am waiting for some text on my SerialPort & after receiveing that text only i have to transmit some text then how i can do that. e.g. say i've to set the date. & am waiting for text "Set Date : "... & after receiveing this on comport i have to transmit "08 NOV 2006" Thanks for your replies, Vinay