Solved

Add Space and Make Bold

Posted on 2006-11-18
3
175 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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…
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…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 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