
'Crea una seconda textbox che ti faccia da 'contenitore per le note poi assegna al tgl la ruotine qui 'sotto. Private Sub ToggleButton1_Click() If ToggleButton1.Value = True Then TextBox2.Text = " ATTENZIONE " Else TextBox2.Text = "" End If End Sub |
Private Sub ToggleButton1_Click() If ToggleButton1.Value = True Then With TextBox2 .BackColor = RGB(255, 0, 0) .Text = " ATTENZIONE " End With Else With TextBox2 .BackColor = &H8000000F .Text = "" End With End If End Sub |
Private Sub ToggleButton1_Click() If ToggleButton1.Value = True Then With TextBox3 .BackColor = RGB(255, 0, 0) .Text = " ATTENZIONE " UserForm1.TextBox1.SetFocus End With Else With TextBox3 .BackColor = &H8000000F .Text = "" UserForm1.TextBox1.SetFocus End With End If End Sub |
Private Sub CdmChiudi_Click()
Unload Me
End Sub
Private Sub CdmChiudi_Enter()
Unload Me
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(TextBox1) = False Then 'se il valore non è un numero
MsgBox "Inserire Numeri" 'in questa tex dobbiamo mettere solo numeri
Cancel = True 'non facciamo uscire se non si mettono numeri nella tex
TextBox1.SelStart = 0 'impostiamo il punto iniziale del valore da selezionare
Else
TextBox1.SelLength = Len(TextBox1)
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If (TextBox2) = "" Then
MsgBox "Metti Qualcosa nel Box 2"
Cancel = True
TextBox2.SelLength = Len(TextBox2) textbox1
End If
End Sub
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
With TextBox3
.BorderStyle = fmBorderStyleSingle
.BorderColor = RGB(125, 125, 250)
.BackColor = RGB(255, 255, 255)
.Text = "Commento Tex 1 "
UserForm1.TextBox1.SetFocus
End With
Else
With TextBox3
.BorderStyle = fmBorderStyleNone
.BackColor = &H8000000F
.Text = ""
UserForm1.TextBox1.SetFocus
End With
End If
End Sub
Private Sub ToggleButton2_Click()
If ToggleButton2.Value = True Then
With TextBox3
.BorderStyle = fmBorderStyleSingle
.BorderColor = RGB(255, 0, 0)
.BackColor = RGB(255, 255, 255)
.Text = " Commento Tex2 "
UserForm1.TextBox2.SetFocus
End With
Else
With TextBox3
.BorderStyle = fmBorderStyleNone
.BackColor = &H8000000F
.Text = ""
UserForm1.TextBox2.SetFocus
End With
End If
End Sub
Private Sub UserForm_Click()
End Sub |
Private Sub CdmChiudi_Click()
Unload Me
End Sub
Private Sub CdmChiudi_Enter()
Unload Me
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If IsNumeric(TextBox1) = False Then 'se il valore non è un numero
MsgBox "Inserire Numeri" 'in questa tex dobbiamo mettere solo numeri
Cancel = True 'non facciamo uscire se non si mettono numeri nella tex
TextBox1.SelStart = 0 'impostiamo il punto iniziale del valore da selezionare
Else
TextBox1.SelLength = Len(TextBox1)
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If (TextBox2) = "" Then
MsgBox "Metti Qualcosa nel Box 2"
Cancel = True
TextBox2.SelLength = Len(TextBox2)
End If
End Sub
Private Sub ToggleButton1_Click()
ToggleButton2.Enabled = False
If ToggleButton1.Value = True Then
ToggleButton1.BackColor = RGB(0, 255, 0)
With TextBox3
.BorderStyle = fmBorderStyleSingle
.BorderColor = RGB(125, 125, 250)
.BackColor = RGB(255, 255, 255)
.Text = "Mi pagherai una pizza!!! "
UserForm1.TextBox1.SetFocus
End With
Else
ToggleButton1.BackColor = &H8000000F
With TextBox3
.BorderStyle = fmBorderStyleNone
.BackColor = &H8000000F
.Text = ""
UserForm1.TextBox1.SetFocus
ToggleButton2.Enabled = True
End With
End If
End Sub
Private Sub ToggleButton2_Click()
ToggleButton1.Enabled = False
If ToggleButton2.Value = True Then
ToggleButton2.BackColor = RGB(0, 255, 0)
With TextBox3
.BorderStyle = fmBorderStyleSingle
.BorderColor = RGB(255, 0, 0)
.BackColor = RGB(255, 255, 255)
.Text = " Anzi due "
UserForm1.TextBox2.SetFocus
End With
Else
ToggleButton2.BackColor = &H8000000F
With TextBox3
.BorderStyle = fmBorderStyleNone
.BackColor = &H8000000F
.Text = ""
UserForm1.TextBox2.SetFocus
ToggleButton1.Enabled = True
End With
End If
End Sub
|
