A part of ListBox.Add's text as bold

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Kelapa
    New Member
    • Jan 2013
    • 1

    A part of ListBox.Add's text as bold

    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?

    Code:
        Private Sub btnFindAndBring_Click(sender As Object, e As EventArgs) Handles btnFindAndBring.Click
            Dim folderName As String
            Dim ifileAmount As Integer
            If FolderBrowserDialog1.
    ShowDialog() <> Windows.Forms.DialogResult.Cancel Then
                folderName = FolderBrowserDialog1.SelectedPath
                lblFolder.Text = folderName
                Dim valueOfStringToFind = My.Computer.FileSystem.FindInFiles(folderName, txtFind.Text, True, FileIO.SearchOption.SearchAllSubDirectories)
                For Each files In valueOfStringToFind
                    ListBox1.Items.Add(files)
                Next
                ifileAmount = ListBox1.Items.Count
                'txtFind.Font = New Font(txtFind.Font, FontStyle.Bold)   'This comment does not work to make bold in a part of string
                ListBox1.Items.Add("- - - -" & "Result of " & txtFind.Text & " has " & ifileAmount & " file(s)" & "- - - -")
            Else
                FolderBrowserDialog1.Dispose()
            End If
        End Sub
Working...