Sofi0813
Member
- Joined
- Jul 25, 2021
- Messages
- 7
- Programming Experience
- 1-3
// I need help C# VS 2019. I am really new!!!
// I want to shuffle the array to get (for example; 0,3,2,1 or 1,3,0,2 etc...) and use the value on my labels, when I click on ButtonNext.
//How to shuffle an array? Lets say the updated array is array2: This means every time I click Next button I am getting four integers in different labels.
// I want to shuffle the array to get (for example; 0,3,2,1 or 1,3,0,2 etc...) and use the value on my labels, when I click on ButtonNext.
//How to shuffle an array? Lets say the updated array is array2: This means every time I click Next button I am getting four integers in different labels.
C#:
int[] array = { 0, 1, 2, 3}; //List of 4 integers.
private void ButtonNext_Click(object sender, EventArgs e) // my next button in Windows Form Application.
{
lblAns1.Text = array2[0]; //This label should get the first position value from the shuffled-array
lblAns2.Text = array2[1]; //This label should get the second position value from the shuffled-array
lblAns3.Text = array2[2]; //This label should get the 3rd position value from the shuffled-array
lblAns4.Text = array2[3]; //This label should get the four position value from the shuffled-array
}
Last edited by a moderator: