Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
Ultra File - frmSearch.vb

frmSearch.vb

Caricato da: Totem
Scarica il programma completo

  1. Imports Ultra_file.Form1
  2. Public Class frmSearch
  3.     Private Sub cmdSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSearch.Click
  4.         If cmbField.SelectedIndex < 0 Then
  5.             MsgBox("Selezionare un campo per la ricerca!", MsgBoxStyle.Exclamation)
  6.             Exit Sub
  7.         End If
  8.  
  9.         For Each L As ListViewItem In Form1.lstFile.Items
  10.             L.ForeColor = Color.Black
  11.             L.Font = New Font(L.Font, FontStyle.Regular)
  12.             Application.DoEvents()
  13.         Next
  14.  
  15.         For Each L As ListViewItem In Form1.lstFile.Items
  16.             If L.SubItems(cmbField.SelectedIndex).Text.ToLower.Contains(txtName.Text.ToLower) Then
  17.                 L.ForeColor = Color.Red
  18.                 L.Font = New Font(L.Font, FontStyle.Bold Or FontStyle.Underline)
  19.             End If
  20.         Next
  21.     End Sub
  22.     Private Sub frmSearch_FormClosing(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
  23.         For Each L As ListViewItem In Form1.lstFile.Items
  24.             L.ForeColor = Color.Black
  25.             L.Font = New Font(L.Font, FontStyle.Regular)
  26.             Application.DoEvents()
  27.         Next
  28.     End Sub
  29.     Private Sub frmSearch_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  30.         For Each S As String() In FieldTable
  31.             cmbField.Items.Add(S(0))
  32.         Next
  33.     End Sub
  34. End Class