Solved

Add Space and Make Bold

Posted on 2006-11-18
3
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17972380
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
ID: 17972436
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 143

Accepted Solution

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

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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