Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Display required text in richtextbox...

How to Display required text in richtextbox...

Scheduled Pinned Locked Moved C#
tutorial
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    IamHuM
    wrote on last edited by
    #1

    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

    _ S 2 Replies Last reply
    0
    • I IamHuM

      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

      _ Offline
      _ Offline
      _mubashir
      wrote on last edited by
      #2

      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 :", ""); Mubashir

      Every job is a self portrait of the person who did it.

      1 Reply Last reply
      0
      • I IamHuM

        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

        S Offline
        S Offline
        saqib82
        wrote on last edited by
        #3

        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.

        I 1 Reply Last reply
        0
        • S saqib82

          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.

          I Offline
          I Offline
          IamHuM
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups