ciao a tutti vorrei rendere questa coda statica solo che non riesco a trovare come si fa..
ma sopratutto vorrei che quando uno schiaccia pop non venga rimossa la textbox ma semplicemente nascosta.. non so come fare aiuto!!!
ecco qua il codice che ho iniziato:
codice:
Public Class Form1
Dim finecoda, i As Integer
Dim titolo As String
Dim messaggio As String
Dim a As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
finecoda = 0
txtstato.Text = "coda vuota"
Beep()
WindowState = 2
Me.Controls.Item("txtcoda_" + CStr(finecoda)).Visible = False
End Sub
Private Sub btnpush_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpush.Click
Dim tmp As System.Windows.Forms.TextBox
titolo = "operazione di push"
If finecoda = 8 Then
Beep()
txtstato.Text = "coda piena"
Else
messaggio = "elemento da inserire"
a = InputBox(messaggio, titolo)
If Len(a) > 0 Then
finecoda = finecoda + 1
Txtstato.Text = CStr(finecoda)
If finecoda > 1 Then
tmp = New System.Windows.Forms.TextBox
tmp.Name = "txtcoda_" + CStr(finecoda - 1)
Me.Controls.Add(tmp)
Me.Controls.Item("txtcoda_" + CStr(finecoda - 1)).Left = txtcoda_0.Left - (finecoda - 1) * 100
End If
With Me.Controls.Item("txtcoda_" + CStr(finecoda - 1))
.Visible = True
.Text = a
End With
End If
End If
End Sub
Private Sub btnfine_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnfine.Click
End
End Sub
Private Sub btnpop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnpop.Click
Dim i As Integer
If finecoda = 0 Then
Beep()
txtstato.Text = "coda vuota "
Else
If finecoda = 1 Then
txtcoda_0.Visible = False
Else
For i = 1 To finecoda
Me.Controls.Item("txtcoda_" + CStr(finecoda - 2)).Text = Me.Controls.Item("txtcoda_" + CStr(finecoda - 1)).Text
Next i
Me.Controls.Remove(Me.Controls.Item("txtcoda_" + CStr(finecoda - 1)))
End If
finecoda = finecoda - 1
Txtstato.Text = CStr(finecoda)
End If
End Sub
End Class