Ciao Marco14,
scusa, hai ragione ho scritto una stupidata.
io ho fatto così:
codice:
Public Class Form1
Dim ParolaSegreta As String = "Topolino"
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
For i As Int16 = 0 To CShort(ParolaSegreta.Length - 1)
TextBox1.Text += "-"
Next
End Sub
Private Sub checkLettera(ByVal lettera As Char)
Dim stringa As String = TextBox1.Text
For i As Int16 = 0 To CShort(ParolaSegreta.Length - 1)
If Char.ToLower(ParolaSegreta(i)) = lettera Then
stringa = stringa.Insert(i, lettera).Remove(i + 1, 1)
TextBox1.Text = stringa
End If
Next
End Sub
End Class
e nell'evento legato all'inserimento della lettera scelta richiami la funzione:
codice:
Private Sub Button_T_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button_T.Click
checkLettera("T")
End Sub
Ho provato e funziona.
Scusa di nuovo.