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?
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