Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Add Space and Make Bold

Posted on 2006-11-18
3
Medium Priority
?
179 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 2000 total points
ID: 17972503
you will rather need the richtextbox instead the normal textbox.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Loops Section Overview
Suggested Courses

782 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