By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,344 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,344 IT Pros & Developers. It's quick & easy.

A part of ListBox.Add's text as bold

P: 1
Here is the lines of code that I only need txtFind.Text's text as bold at the last part of ListBox1.Add(........)
How do I make it?

Expand|Select|Wrap|Line Numbers
  1.     Private Sub btnFindAndBring_Click(sender As Object, e As EventArgs) Handles btnFindAndBring.Click
  2.         Dim folderName As String
  3.         Dim ifileAmount As Integer
  4.         If FolderBrowserDialog1.
  5. ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
  6.             folderName = FolderBrowserDialog1.SelectedPath
  7.             lblFolder.Text = folderName
  8.             Dim valueOfStringToFind = My.Computer.FileSystem.FindInFiles(folderName, txtFind.Text, True, FileIO.SearchOption.SearchAllSubDirectories)
  9.             For Each files In valueOfStringToFind
  10.                 ListBox1.Items.Add(files)
  11.             Next
  12.             ifileAmount = ListBox1.Items.Count
  13.             'txtFind.Font = New Font(txtFind.Font, FontStyle.Bold)   'This comment does not work to make bold in a part of string
  14.             ListBox1.Items.Add("- - - -" & "Result of " & txtFind.Text & " has " & ifileAmount & " file(s)" & "- - - -")
  15.         Else
  16.             FolderBrowserDialog1.Dispose()
  17.         End If
  18.     End Sub
Jan 15 '13 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.