Hey everyone,
I'm exceptionally new to VB.Net and Windows forms, and this has got me stumped.
I have created a tiny little app which has 4 panels.
By default, all panels are invisible.
The list of panel names is stored in an array.
From a sub I try to set the parameter 'Visible = True' like so...Code:Dim aryPanels() As System.Windows.Forms.Panel = {Panel1, Panel2, Panel3, Panel4}
orCode:aryPanels(UBound(aryPanels)).Visible = True
which in my mind should be the equivalent of this:Code:aryPanels(1).Visible = True
The latter works from the sub when it's hardcoded. The first, which is what I need to do, does not.Code:Panel2.Visible = True
I'd like to attach the project but can't see where, but if anyone can tell me how I can set parameters of Panels in an array, I'd be hugely grateful!
Thanks,
Scott





Reply With Quote