Solved

Add Space and Make Bold

Posted on 2006-11-18
3
172 Views
Last Modified: 2010-04-23
Hello, I'm populating a textbox with values from a dataset which works fine. See partial code below. I want to add a space between the returned rows and make the first values bold.


Code:

txtASVResults.Text = String.Empty
            For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
                txtASVResults.Text &= ds.Tables(0).Rows(i).Item("verse")
                txtASVResults.Text &= ds.Tables(0).Rows(i).Item("passage") & ControlChars.CrLf
            Next

What is returned:

1In the beginning God created the heavens and the earth.
2And the earth was waste and void; and darkness was upon the face of the deep: and the Spirit of God moved upon the face of the waters

What I want: (but with the verse in bold)

1 In the beginning God created the heavens and the earth.
2 And the earth was waste and void; and darkness was upon the face of the deep: and the Spirit of God moved upon the face of the waters

0
Comment
Question by:gogetsome
  • 2
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
assuming that the textbox displays as html code:

            For i As Integer = 0 To ds.Tables(0).Rows.Count - 1
                txtASVResults.Text &= ds.Tables(0).Rows(i).Item("verse")
                txtASVResults.Text &= " <b>"
                txtASVResults.Text &= ds.Tables(0).Rows(i).Item("passage")
                txtASVResults.Text &= "</b>" & ControlChars.CrLf
            Next
0
 

Author Comment

by:gogetsome
Comment Utility
Thank Angel for your post. There was no change in the output. This is for a winforms application. I should have mentioned that, sorry. Is it possible to change a property of a winfrom textbox to display HTML?

0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
you will rather need the richtextbox instead the normal textbox.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now