0

I am trying to build a navigation system and includes a back button. The back button when clicked makes the last visible panel visible again.

The back button is a linklabel which executes the below line.

_backLocation.visible= true;

_backLocation is a string variable that contains the panel name that was last visible. Once the user navigates away from a panel that panel is made invisible.

However the above line isn't valid code and doesn't compile. Is there a way to achieve this simple solution or maybe a better way?

CodeCaster
  • 147,647
  • 23
  • 218
  • 272
KingCundy
  • 75
  • 1
  • 8
  • Why use a `String` variable in the first place? Why not use a variable that you can assign the `Panel` itself to? – jmcilhinney Sep 16 '15 at 10:35

1 Answers1

3

Either save the last visible control in a private Control _previousControl or find the control by name.

Community
  • 1
  • 1
CodeCaster
  • 147,647
  • 23
  • 218
  • 272