That's probably because you haven't thought about what you are trying to do, but have just guessed and hoped it would work: that isn't a successful strategy in computer (or any other field I know of, either)
Let's loop at the most obvious problems - the ones that cause compilation errors:
1) There is no static method Random.Next - you need an instance of the Random class to use the Next method. As a result you get the error:
"An object reference is required for the non-static field, method, or property ..."
Fix it by creating a class level instance:
private Random rand = new Random();
and using that instead.
2) Statements in c# are all terminated by a semicolon: that means you get a
"; expected"
Fix it by adding a semicolon to the end of each instruction.
3) C# is case sensitive, so "Visible" and "visible" are different - you need to use exactly the right name, which is "Visible"
Fix it by changing "visible" to "Visible"
4) Integers do not have a
Visible
(or
visible
) property, because they are not displayable user elements (or "controls" as they are known).
Fix: complicated...
The big problem is that a number is not a label, even if it is in some way related to the name of the label - and while there are ways to get the actual label of that name via reflection, that's advanced stuff and far, far beyond your skill level.
Instead, try using a simple if statement:
int hideMe = rand.Next(numberOfLabelsLeft);
if (hideMe == 0) label1.Visible = false;
else if (hideMe == 1) label2.Visible = false;
else if (...
You get the idea...
You can do it using an array or a list, but the collection would have to contain the actual objects (Label class instances) rather than strings.