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
trova parole - Form1.vb

Form1.vb

Caricato da: Walker93
Scarica il programma completo

  1. 
  2. Imports Microsoft.Office.Interop.Word
  3.  
  4. Public Class Form1
  5.     Dim a As New Microsoft.Office.Interop.Word.Application
  6.     Dim lett(0 To 6) As String
  7.     Dim x As Integer
  8.     Dim i As Integer
  9.     Dim k As Integer
  10.     Dim m, n, b, v, c, z, formula As String
  11.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  12.         ProgressBar1.Visible = True
  13.         ProgressBar1.Value = 0
  14.         i = 0
  15.         ListBox1.Items.Clear()
  16.         ListBox2.Items.Clear()
  17.         lett(1) = Mid(TextBox1.Text, 1, 1)
  18.         lett(2) = Mid(TextBox1.Text, 2, 1)
  19.         lett(3) = Mid(TextBox1.Text, 3, 1)
  20.         lett(4) = Mid(TextBox1.Text, 4, 1)
  21.         lett(5) = Mid(TextBox1.Text, 5, 1)
  22.         lett(6) = Mid(TextBox1.Text, 6, 1)
  23.         For q = 1 To 6
  24.             For w = 1 To 6
  25.                 For r = 1 To 6
  26.                     For t = 1 To 6
  27.                         For y = 1 To 6
  28.                             For u = 1 To 6
  29.                                 If Not (u = y Or u = t Or u = r Or u = w Or u = q Or y = t Or y = r Or y = w Or y = q Or t = r Or t = w Or t = q Or r = w Or r = q Or w = q) Then
  30.                                     formula = lett(t) & lett(y) & lett(u)
  31.                                     If ListBox1.Items.Contains(formula) = False Then
  32.                                         ListBox1.Items.Add(formula)
  33.                                     End If
  34.                                     formula = lett(r) & lett(t) & lett(y) & lett(u)
  35.                                     If ListBox1.Items.Contains(formula) = False Then
  36.                                         ListBox1.Items.Add(formula)
  37.                                     End If
  38.                                     formula = lett(w) & lett(r) & lett(t) & lett(y) & lett(u)
  39.                                     If ListBox1.Items.Contains(formula) = False Then
  40.                                         ListBox1.Items.Add(formula)
  41.                                     End If
  42.                                     formula = lett(q) & lett(w) & lett(r) & lett(t) & lett(y) & lett(u)
  43.                                     If ListBox1.Items.Contains(formula) = False Then
  44.                                         ListBox1.Items.Add(formula)
  45.                                     End If
  46.                                     Application.DoEvents()
  47.                                 End If
  48.                             Next
  49.                         Next
  50.                     Next
  51.                 Next
  52.             Next
  53.         Next
  54.  
  55.         For Each d As String In ListBox1.Items
  56.             If ListBox2.Items.Contains(d) = False Then
  57.                 If a.CheckSpelling(d) = True Then
  58.                     ListBox2.Items.Add(d)
  59.                     Application.DoEvents()
  60.                 End If
  61.             End If
  62.             i = i + 1
  63.             x = (i * 100) / ListBox1.Items.Count
  64.             If x > 100 Then
  65.                 x = 100
  66.             End If
  67.             ProgressBar1.Value = x
  68.             If ProgressBar1.Value = 100 Then
  69.                 My.Computer.Audio.PlaySystemSound(Media.SystemSounds.Exclamation)
  70.                 ProgressBar1.Visible = False
  71.             End If
  72.             perc.Text = ProgressBar1.Value & "%"
  73.             par.Text = ListBox2.Items.Count
  74.         Next
  75.     End Sub
  76. End Class