Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Add Space and Make Bold

Posted on 2006-11-18
3
Medium Priority
?
178 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 2000 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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
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…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses

730 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