Picture name constants

I added a bunch of pictures to my project named Header1, Header2 etc. In the open event of a DesktopCanvas I want to select a Header by random. But: how to I add a random integer to the ‘Header’ name constant?

Var Choice As Integer = System.Random.InRange(1,3)
Me.Backdrop = "Header" + Choice.ToString

Does not compile. Is there some trick with quotes or else?

  1. Define an array and add the pictures into it.
  2. Use System.Random to choose a random array index.
  3. Assign Me.Backdrop with the picture from the array with the chosen index.
1 Like

Right. Thanks!