I solved my updated problem my self!
here is the code i sued to solve the UPDATED problem NOT the first problem:
first i declare a public List like this:
public List<string> ButtonList = new List<string>();
</string></string>
next i add all the buttons i want to manipulate:
ButtonList.Add(V.Name);
ButtonList.Add(W.Name);
ButtonList.Add(X.Name);
ButtonList.Add(Y.Name);
ButtonList.Add(Z.Name);
ButtonList.Add(Sqig.Name);
ButtonList.Add(Btn1.Name);
ButtonList.Add(Btn2.Name);
ButtonList.Add(Btn3.Name);
and now when i want to make the buttons disappear or reappear i just illiterate through the list like this:
foreach (string ctrl in ButtonList)
{
this.Controls[ctrl].Visible = false;
}
--UPDATE--
this update is thanks to BillWoodruff and his solution.
so instead of adding all the controls manualy i just get all the controls of the type "Button and add those to the list like this:
ButtonList = this.Controls.OfType<Button>().ToList();
i had to change the ButtonList declaration line from:
public List<string> ButtonList = new List<string>();
to:
public List<Button> ButtonList = new List<Button>();
i just changed the List type from string to Button
but i didn't want 5 of the function buttons i just wanted the Onscreen keyboard buttons to be added to the list so i just removed them like this:
ButtonList.Remove(LockThisComputer);
and then when i want to change something with the buttons i just illiterate through the list like this:
foreach (Button ctrl in ButtonList)
{
ctrl.Visible = Boolean.Parse(OskEnabled);
}
in conclusion both of the solutions work its just that the updated one is sooo much easier.
thank you all very much for helping me with my coding problems,
MasterCodeon