Wednesday, April 20, 2011

richtextbox in vb.net

i am using a richtext box in my vb.net application and i need to dispaly top ten records from the database in it.but it is displaying only 1 record.what to do?? kindly help.....

From stackoverflow
  • I think you may have chosen the wrong control. You may want to look into using a GridView, or some other control that exists to display multiple records.

    If you really want to display the values of 10 records in a TextBox, you'll have to approach the problem differently. You can concatenate the values into a string and assign it to the Text property of the TextBox, although I don't think this is really a good solution.

  • i have used the following lines of code and it works absolutely fine:

    If rcount < 10 Then rcount = rcount + 1 RtxtMessage.ScrollBars = RichTextBoxScrollBars.None RtxtMessage.Text = RtxtMessage.Text + " " + CType(dv.Item(i)("audit_message"), String) & vbCrLf End If

0 comments:

Post a Comment