Ma se il pallino è VERDE mi deve aprire il Form di scelta per cosa voglio fare...
Si apre quindi, come scritto nel codice questa finestra di dialogo...
Allegato 29123
l'utente, se deve estendere il colloqui, stabilisce prima di quanto cliccando su 1 dei 3 radio button.
Nella vista codice ecco il tutto...
codice:
Public Class FormScelta
Dim Est As Integer
Dim StartTime As DateTime
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
'pulsante di chiusura del form
Me.Close()
End Sub
Private Sub Scelta_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'all'avvio del form i 3 radio button sono deselezionali e il pulsante di riferimento è disabilitato
RB1ora.Checked = False
RB2ore.Checked = False
RB3ore.Checked = False
BTNEstendi.Enabled = False
End Sub
Private Sub RB1ora_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RB1ora.CheckedChanged
'se l'utente fa click sul radio button 1 per estendere la durata di 1 ora, si abilita il pulsante "estendi"
BTNEstendi.Enabled = True
End Sub
Private Sub RB2ore_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RB2ore.CheckedChanged
'se l'utente fa click sul radio button 2 per estendere la durata di 2 ore, si abilita il pulsante "estendi"
BTNEstendi.Enabled = True
End Sub
Private Sub RB3ore_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles RB3ore.CheckedChanged
'se l'utente fa click sul radio button 3 per estendere la durata di 3 ore, si abilita il pulsante "estendi"
BTNEstendi.Enabled = True
End Sub
Private Sub BTNEstendi_Click(sender As System.Object, e As System.EventArgs) Handles BTNEstendi.Click
'se l'utente ha selezionato il radio botton 1, Est = a 3600
If RB1ora.Checked = True Then
Est = 3600
End If
'se l'utente ha selezionato il radio botton 2, Est = a 7200
If RB2ore.Checked = True Then
Est = 7200
End If
'se l'utente ha selezionato il radio botton 3, Est = a 10800
If RB3ore.Checked = True Then
Est = 10800
End If
Select Case Label2.Text
Case "S1P1"
If MsgBox("ATTENZIONE!, stai estendendo la durata del colloquio!... CONFERMI?", MsgBoxStyle.YesNo + MsgBoxStyle.Information) = MsgBoxResult.Yes Then
FormColloqui.LBTimerS1P1.Text += Val(Est) - (Now - StartTime).TotalSeconds
FormColloqui.CBSala1Posto1.Text += 1
End If
Case "S1P2"
If MsgBox("ATTENZIONE!, stai estendendo la durata del colloquio!... CONFERMI?", MsgBoxStyle.YesNo + MsgBoxStyle.Information) = MsgBoxResult.Yes Then
FormColloqui.LBTimerS1P2.Text += Val(Est) - (Now - StartTime).TotalSeconds
FormColloqui.CBSala1Posto2.Text += 1
End If
Case "S1P3"
If MsgBox("ATTENZIONE!, stai estendendo la durata del colloquio!... CONFERMI?", MsgBoxStyle.YesNo + MsgBoxStyle.Information) = MsgBoxResult.Yes Then
FormColloqui.LBTimerS1P3.Text += Val(Est) - (Now - StartTime).TotalSeconds
FormColloqui.CBSala1Posto3.Text += 1
End If
End Select
Me.Close()
End Sub
Private Sub BTNInterrompi_Click(sender As System.Object, e As System.EventArgs) Handles BTNInterrompi.Click
Note.ShowDialog()
Select Case Label2.Text
Case "S1P1"
FormColloqui.LBTimerS1P1.Text = "1"
Case "S1P2"
FormColloqui.LBTimerS1P2.Text = "1"
Case "S1P3"
FormColloqui.LBTimerS1P3.Text = "1"
Case "S1P4"
FormColloqui.LBTimerS1P4.Text = "1"
Case "S1P5"
FormColloqui.LBTimerS1P5.Text = "1"
Case "S1P6"
FormColloqui.LBTimerS1P6.Text = "1"
Case "S1P7"
FormColloqui.LBTimerS1P7.Text = "1"
Case "S1P8"
FormColloqui.LBTimerS1P8.Text = "1"
Case "S1P9"
FormColloqui.LBTimerS1P9.Text = "1"
Case "S1P10"
FormColloqui.LBTimerS1P10.Text = "1"
End Select
Me.Close()
End Sub
End Class
Onestamente non riesco a capire dove sia l'errore...