Dr Nick Riviera
28-06-2007, 03:31
Salve, sto provando a utilizzare lo switch su 2 radiobutton, ho cercato in giro ed ho trovato alcuni pezzi di codice.. ma ho qualche problema...
In pratica io ho messo 2 radiobutton in un panel e a seconda del radiobutton selezionato esegue un evento o ne esegue un altro..
Per associare l'evento ai radiobutton ho trovato un esempio dove inserisce:
if (radiobutton1.Checked) {intServiceChoiceLocal = 1;}
else if (radiobutton2.Checked) {intServiceChoiceLocal = 2;}
switch (intServiceChoiceLocal)
{
case 1:
...
case 2:
...
...
Però ottengo questo errore:
Error 1 The name 'intServiceChoiceLocal' does not exist in the current context
Probabilmente dovrò includere una libreria in cima al form, ma non ho idea di quale sia e se sia effettivamente quello il problema..
:confused:
In pratica io ho messo 2 radiobutton in un panel e a seconda del radiobutton selezionato esegue un evento o ne esegue un altro..
Per associare l'evento ai radiobutton ho trovato un esempio dove inserisce:
if (radiobutton1.Checked) {intServiceChoiceLocal = 1;}
else if (radiobutton2.Checked) {intServiceChoiceLocal = 2;}
switch (intServiceChoiceLocal)
{
case 1:
...
case 2:
...
...
Però ottengo questo errore:
Error 1 The name 'intServiceChoiceLocal' does not exist in the current context
Probabilmente dovrò includere una libreria in cima al form, ma non ho idea di quale sia e se sia effettivamente quello il problema..
:confused: