Jump to content
Xtreme .Net Talk

Clear a RichTextBox ... its not clearing Help please


Recommended Posts

Posted

I know I know ... this sounds stupid ...

 

But this RTB is about to drive me nuts

 

I have contents of an array in the rtb and I need to clear whast in the rtb so I can update it with new content but what I am getting is this

 

lets say I have

1

2

3

I have the above for example displayed in rtb when I update the rtb I get this

1

2

3

1

2

3

Its not clearing the other text before adding evn though I am telling it to

 

Her is my code

            
           ' Why doesnt rtbDes.text = "" get it done???????
           rtbDes.Text = ""


           For i As Integer = 0 To myPubAr.Count - 1

               rtbDes.Text = rtbDes.Text & myPubAr(i) & "..........." & myLocAr(i) & vbCrLf
           Next

 

I know this has got to be simple ... if I do this in lets say a listbox I can easily clear it an give it the update ... why not this stupid RTB?

 

ALL help very much appreciated

 

vbMarkO

Visual Basic 2008 Express Edition!
Posted

You pointed the way ... it was the array ... I needed to clear it first as when I was updating it was adding the info back into the array so the rtb was clearing as it should Thanx so very much

 

THIS IS RESOLVED

 

myPuAr.CLear()

myLocAr.Clear() did the trick

Thanx

Visual Basic 2008 Express Edition!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...