P
Pablo Salazar
Hi people
I try to fill treeview but when i compile the programa it gave me the
following error :
"Use of Unassigned local variable 'nombre' "
public void Agregar(TreeNode x,int tipo)
{
string nombre;
switch (tipo)
{
case 1 :
nombre = "Elemento";
break;
case 2 :
nombre = "Atributo";
break;
case 3 :
nombre = "Comentario";
break;
case 4 :
nombre = "Texto";
break;
}
TreeNode t = new TreeNode(nombre );
t.SelectedImageIndex = tipo ;
t.ImageIndex = tipo;
t.Tag = "";
x.Nodes.Add (t);
}
Thanks.
I try to fill treeview but when i compile the programa it gave me the
following error :
"Use of Unassigned local variable 'nombre' "
public void Agregar(TreeNode x,int tipo)
{
string nombre;
switch (tipo)
{
case 1 :
nombre = "Elemento";
break;
case 2 :
nombre = "Atributo";
break;
case 3 :
nombre = "Comentario";
break;
case 4 :
nombre = "Texto";
break;
}
TreeNode t = new TreeNode(nombre );
t.SelectedImageIndex = tipo ;
t.ImageIndex = tipo;
t.Tag = "";
x.Nodes.Add (t);
}
Thanks.