How can i AppendText to richTextBox only if the text is new(different) from the text that is already in the richTextBox ?

Code
public void ScrollNews()
listsext.Ext(page);
combindedString = string.Join(Environment.NewLine, ListsExtractions.myList);
richTextBox1.SelectAll();
richTextBox1.SelectionAlignment = HorizontalAlignment.Right;
richTextBox1.AppendText(combindedString);
scrollerText = string.Join(Environment.NewLine, ListsExtractions.myListWithoutLinks);
scroller1.TextToScroll = scrollerText;
if (NewsLevels.newsLevel && NewsLevels.shouldStart)
UpdateTextControls();
scroller1.Start();
NewsLevels.shouldStart = false;
if (NewsLevels.newsLevel == false && NewsLevels.shouldStart)
UpdateTextControls();
scroller1.Start();
NewsLevels.shouldStart = false;
string[] rlines = richTextBox1.Lines;
richTextBox1.SelectionStart = 0;
richTextBox1.SelectionLength = rlines[0].Length;
richTextBox1.SelectionColor = Color.Red;
richTextBox1.Select(rlines[0].Length, rlines[1].Length + 1);
richTextBox1.SelectionColor = Color.Green;
RedColorAlert1();
if (lines == null)
label5.Text = "0";
else
label5.Text = lines.Length.ToString();
The line is:
richTextBox1.AppendText(combindedString);
I'm calling this method ScrollNews every X minutes with a timer.
The way it is now it will AppendText all the time. But i want it to Add the combinededString only if the text in combindedString was different from the text that is already in the richTextBox. Somhow to keep all the time the last text and compare it and
if there is a new text then appen it.

public void Scroll()
listsext.Ext(page);
combindedString = string.Join(Environment.NewLine, ListsExtractions.myList);
richTextBox1.SelectAll();
StringBuilder sb = new StringBuilder();
sb.Append(combindedString);
richTextBox1.SelectionAlignment = HorizontalAlignment.Right;
richTextBox1.AppendText(combindedString);
The problem is that now it will keep adding to the richTextBox the content in combindedString over and over again. I need somehow to check each time if the content in combindedString already exist in the richTextBox if not meaning it's new content then AppendText
it.
If it's the same already exist do nothing don't add it.
EDIT
I write to a text file the content of the ombindedString variable .The first content the lines is the combindedString:
המשטרה עצרה אמא ל2 ילדים קטנים שבעלה נעצר בחשד למעורבות בעלה בכריתת עצים
15:03 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189935.shtml
אדם החשוד בעבירת מין בקטינים נעצר לאחר שהתלונן על 2 שסוחטים אותו על רקע מעשיו
14:50 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189932.shtml
אינדונזיה: 5 הרוגים בקריסת האנגר בנמל תעופה
14:44 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189930.shtml
אום אל-פחם: מספר חשודים עוכבו בחשד למעורבות במימון טרור
14:04 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189914.shtml
אלמנתו של רפ''ק ג'דעאן אסעד, שנרצח בפיגוע הדריסה, ילדה בן
13:05 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189884.shtml
תנאי ליברמן לכניסה לממשלה עונש מוות למחבלים חובת חתימה על מסמך נאמנות
12:39 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189868.shtml
תלמיד תיכון מרחובות חשוד שהפעיל מעבדה ביתית לזיוף תעודות זהות ואישורי מחלה
12:03 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189856.shtml
הצביעות של רענן שקד: האשים את אמהות 3 החטופים ומגנה את חגי הוברמן
11:43 דווח במקור בתאריך : 09.03.15 : שעה
http://rotter.net/forum/scoops1/189848.shtml
And this is a screenshot i couldnt copy the text of the richTextBox1.Text
richTextBox1.Text content image
co uld be that the format of the text in the combindedString and the richTextBox1.Text looks different so it think it's not exist ?
Update:
Not sure if it's important but the combindedString i'm adding the text to it from the variable ListExtractions.myList
myList is List and i build this List like that:
private void ListToStringList(List<string> myl)
for (int i = 0; i < AllNews.Count; i++)
myl.Add(AllNews[i].text);
IFormatProvider provider = CultureInfo.InvariantCulture;
DateTime myTime = DateTime.ParseExact(AllNews[i].original_time, "DyyMMddTHHmm", provider);
string results = myTime.ToString("HH:mm דווח במקור בתאריך : dd.MM.yy : שעה");
myl.Add(results);
myl.Add(AllNews[i].link);
myl.Add(Environment.NewLine);
myListWithoutLinks.Add(AllNews[i].text);
myListWithoutLinks.Add(results);
myListWithoutLinks.Add(Environment.NewLine);
for (int i = 0; i < myl.Count; i++)
myl[i] = Regex.Replace(myl[i], @"\t|\n|\r", "");
And use it:
ListToStringList(myList);

Similar Messages

  • How can I transfer music not purchased on iTunes to my new computer from my iPod?

    I recently got a new computer and wanted the music from my iPod on it. I have a ton of CD's so over half the things I have on my iPod aren't things I purchased from iTunes.
    When I went through the process of transferring (it only gave the option to transfer purchases) there were no songs from any of my CDs.
    I have tried everything I know how and still I have not found anything to actually help. I've backed it up and there is still nothing new in my iTunes.
    Why can I not transfer items not purchased from iTunes to my new computer? How do I do this?
    I would greatly appreciate it if you would put an answer in the simplest form possible as I am not very tech-savvy.
    I would also like to do this simply and without downloading another program if at all possible.
    I have a Windows 7 computer if that is of any help.
    Thank you!

    That is included here:
    Syncing to a "New" Computer or replacing a "crashed" Hard Drive: Apple Support Communities

  • Can I download software from App store that I already own the disc without being charged?

    I own Call of Duty 4 on disk and it is loaded on my MBP, but I was wondering if I can download it from the App store so that any updates, for example, can be kept up to date, without being charged again for the software?

    No unfortunately that is not possible. If you bought the app on disk you would have to buy it again to get it from the app store.

  • I can't view the pictures I've downloaded from my ipad to my PC. The only options I have is Tunes, TV, Movies or Apps. How do I view pictures on my PC.

    I can't view the pictures I've downloaded from my ipad to my PC. The only options I have is Tunes, TV, Movies or Apps. How do I view pictures on my PC.

    What happens when you try to play the actual film ? And have you tried deleting them and (assuming that they're still in the store) redownloading them via the Purchased link under Quick Links on the right-hand side of the iTunes store home page - or going into Edit > Preferences and on the Store tab ticking the 'show iTunes in the Cloud purchases' tick box so that they show in the My Movies part of your library with a cloud icon against it for redownloading) ?
    (You can't store films in the cloud, whether they will show there for redownloading depends upon what country that you are in - and if you move countries or if the rights-holder removes them then you also won't be able to redownload them. Ideally you'd be taking a backup copy of all of your downloads, and not relying on being able to redownload them in the future.)

  • When I facetime the ipad (email address) it calls my phone. The accounts are completely separate. How can I get this to only call the ipad and not my phone as well?

    When I facetime the ipad (email address) it calls my phone. The accounts are completely separate. How can I get this to only call the ipad and not my phone as well?
    It calls both the ipad and iphone when calling the associated email address for the ipad. However, when I call the iphone it does not call the IPAD.
    Thanks for your help

    Are you trying to message another Apple device?
    Using FaceTime http://support.apple.com/kb/ht4319
    Troubleshooting FaceTime http://support.apple.com/kb/TS3367
    The Complete Guide to FaceTime + iMessage: Setup, Use, and Troubleshooting
    http://tinyurl.com/a7odey8
    Troubleshooting FaceTime and iMessage activation
    http://support.apple.com/kb/TS4268
    Using FaceTime and iMessage behind a firewall
    http://support.apple.com/kb/HT4245
    iOS: About Messages
    http://support.apple.com/kb/HT3529
    Set up iMessage
    http://www.apple.com/ca/ios/messages/
    Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Setting Up Multiple iOS Devices for iMessage and Facetime
    http://macmost.com/setting-up-multiple-ios-devices-for-messages-and-facetime.htm l
    FaceTime and iMessage not accepting Apple ID password
    http://www.ilounge.com/index.php/articles/comments/facetime-and-imessage-not-acc epting-apple-id-password/
    Unable to use FaceTime and iMessage with my apple ID
    https://discussions.apple.com/thread/4649373?tstart=90
     Cheers, Tom

  • How can I use table headers only without using rows.

    how can I use table headers only, without using rows and without leaving the space.
    If anyone could say me how to paste the pic in this questions, I would have shown it.
    The flow of view is in this way
    {Table header(table on top of table)
    column header1___|| column header2__ || column header3__ ||}
    <b>Here is the blank space I am getting, How to avoid this space?this space is of one table row height</b>
    {Contents column1 || Contents column2 || Contents column3 || (This is of other table below the uper table)}
    I am using scroll for the content part of table only.
    So I am using two tables.
    I am using NW04.

    I did the possibles you explained, but couldn't get rid off the space.
    Any other solutions?
    I am keeping the header static and the content columns scrollable.
    I have used two tables one to display header above and the other to display only the contents.
    I have put the contents table in scroll container.
    And the header table in transperent container.
    Thanks and Regards,
    Hanif Kukkalli

  • How can I buy movies available only on another country's iTunes?

    how can I buy movies available only on another country's iTunes?

    You can't, you can only buy from your own country's store - to be able to buy from another country you will need to be in that country and have a valid billing address, and iTunes account. in that country. You can try requesting that the films that you want to buy be added to your store, but ultimately it's the film studios decision : http://www.apple.com/feedback/itunes.html

  • How can i fix white display only shows apple logo ond loading symbol

    How can i fix white display only shows apple logo ond loading symbol! Pls help me guys!

    shutdown your mac by holding power button. Then Hold CMD+V and press power button now it will start to show some text wait for few minutes and somewhere it will stop post that screenshot

  • How can I open Internet explorer only pages on a mac? The website that I need to access only permits internet explorer

    How can I open Internet explorer 'only' pages on a mac, without creating a drive partition and installing windows separately?
    I've tried winbottler, but it doesn't seem to serve my purpose. The web site that I'm trying to access only permits Internet explorer.

    Microsoft has not written IE for Mac for years so unless you want to create a parition and install Windows, or user a Windows emulator, you're out of luck for installing IE on a Mac.
    The web site that I'm trying to access
    There might be a work around for you since it's just the one site.
    Go to the Safari menu bar click Safari > Preferences then select the Advanced tab.
    Enable the Develop menu.
    Now click Develop from the Safari menu bar then click User Agent > IE 9, 8, or 7

  • I have CS6 and CC installed on my mac when I'm using CS6 and use bridge CC activates how can I set this to only work on one and not the other

    I have CS6 and CC installed on my mac when I'm using CS6 and use bridge CC activates how can I set this to only work on one and not the other

    If you want Bridge CS6 to open when using Photoshop CS6, you must quit Bridge CC.
    Then File menu > Browse in Bridge will bring up Bridge CS6.
    If Bridge CC is already open, The File > Browse in Bridge for Photoshop CS6 will use Bridge CC and Bridge CS6 will not open.
    I hope that's the answer you were looking for.
    Gene

  • How can I make my computer only recognize my network and not that of one of my neighbors?

    How can I make my computer only recognize my network and not that of one of my neighbors? This is for when I am at home, and everytime the computer goes to sleep it essentially loses the connection, only to pick up my neighbors network when it is awaken.
    I am on Comcast (Xfinity) Highspeed Cable wireless modem/router
    Thanks in advance!
    Mark

    You can make your network the preferred network.
     > System Preferences... > Network > Advanced... > Drag your preferred network name to the top of the list.

  • How can i develop charts using only xml defination

    how can i develop charts using only xml defination.can any one please let me know
    manks

    hello,
    in reports 6i the charts are created using oracle graphics which stores the chart definitions in a separate file (.OGD). there is not XML interface for graphics.
    with reports 9i and the introduction of the BIgraphBean the definition of the chart-properties is also done in XML.
    reports 9i will be available with iAS Release 2.
    regards,
    the oracle reports team

  • TS2634 i have i pad broken screen , how can i changed it is only three month old

    i have i pad broken screen , how can i changed it is only three month old

    It will cost you approximately US$250.00 to US$300.00
    Apple will replace the entire iPad; they don't repair.
    http://support.apple.com/kb/index?page=servicefaq&geo=United_States&product=ipad

  • How can I make it so only my iPhone works on my Apple TV and my daughters iPods will not???

    I want to make it so only my iPhone can play music/videos on my Apple TV, but my daughters can stream with the automatic airplay option. My daughters are getting apple tvs for there bedroom tvs so I want there ipod touches to work for there individual tvs only??

    teddyo123 wrote:
    When I enter the music app, I just want to listen to the music that I've downloaded onto my device, not old music I don't want, but is still shown for streaming. Any help/ideas? I don't want to have to go offline just to listen to the music I want to listen to everytime
    Why would you have to go offline to listen to music? Dosn't make sense.
    However, you can set the app up to just show you tracks that are actually on the device: Settings app > Music > Show All Muisc [turn OFF]

  • On my iPad Mini (2013), How can I make it so, only my downloaded music is shown in the Music app, and not old music I haven't downloaded/ don't want on my iPad?

    When I enter the music app, I just want to listen to the music that I've downloaded onto my device, not old music I don't want, but is still shown for streaming. Any help/ideas? I don't want to have to go offline just to listen to the music I want to listen to everytime

    teddyo123 wrote:
    When I enter the music app, I just want to listen to the music that I've downloaded onto my device, not old music I don't want, but is still shown for streaming. Any help/ideas? I don't want to have to go offline just to listen to the music I want to listen to everytime
    Why would you have to go offline to listen to music? Dosn't make sense.
    However, you can set the app up to just show you tracks that are actually on the device: Settings app > Music > Show All Muisc [turn OFF]

Maybe you are looking for