Questo topic e' stato chiuso dal moderatore.
30/10/10 7:04
carmine
ragazzi per un progetto a scuola devo riuscire a leggere un bottone OK, cambiando ogni volta il testo di una label, nella stessa form, come faccio? ho provato con un case e per i primi menu funziona poi quando si va ai sottomenu nn funz...
ho usato variabili booleane e controlli ora posto il codice:
gli incrementi degli indici li faccio in altre 2 bottoni, avanti e indietro
ekko:
Indietro:
Avanti:
ho usato variabili booleane e controlli ora posto il codice:
Private Sub PictureBox3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox3.Click Select Case i Case 0, 1 Label1.Text = Spec(j) Specia = True men = False If a = True Then If j <= 3 Then Label1.Text = Classi(k) clas = True Specia = False End If End If If b = True Then clas = False If k = 0 Then If ele = False Then Label1.Text = Prime(l) inf = True End If If inf = False Then Label1.Text = Prime(l) ele = True End If End If End If End Select End Sub
gli incrementi degli indici li faccio in altre 2 bottoni, avanti e indietro
ekko:
Indietro:
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox1.Click If men = True Then 'controllo primo menu per de-incremento indice If i > 0 Then i = i - 1 Label1.Text = Menu(i) End If End If If Specia = True Then 'secondo menu scelta specializzaizione a = True If j > 0 Then j = j - 1 Label1.Text = Spec(j) End If End If If clas = True Then 'scelta classe b = True If k > 0 Then k = k - 1 Label1.Text = Classi(k) End If End If If l > 0 Then If inf = True Then l = l - 1 Label1.Text = Prime(l) End If If ele = True Then l = l - 1 Label1.Text = Prime(l) End If End If End Sub
Avanti:
Private Sub PictureBox5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PictureBox5.Click If men = True Then If i < 1 Then i = i + 1 Label1.Text = Menu(i) End If End If If Specia = True Then a = True If j < 3 Then j = j + 1 Label1.Text = Spec(j) End If End If If clas = True Then b = True If k < 4 Then k = k + 1 Label1.Text = Classi(k) End If End If If l < 9 Then If inf = True Then l = l + 1 Label1.Text = Prime(l) End If If ele = True Then Label1.Text = Prime(l) If l >= 1 Then l = 1 End If Else l = l + 1 End If End If End Sub
Ultima modifica effettuata da carmine 30/10/10 7:06
aaa