I have a rather sprawling application-in-progress in Visual Basic .NET
2003, and I'm using very specific naming conventions to avoid confusion
and make the function of my code as self-evident as possible.
Below is an example, the name of a recently-declared Command Button:
TabControl_Main_TabPage_MapEditor_TabControl_TileP roperties_TabPage_Graph
ic_Button_AddGraphic
I'd love it if I could, in the interests of clarity, refer to that button
using a more organic structure, such as:
TabControl_Main.TabPage_MapEditor.TabControl_TileP roperties.TabPage_Graph
ic.Button_AddGraphic
After a couple of aborted attempts at using structures (No 'New' or
'WithEvent' declarations supported therein), I decided to try using
classes, a previously unexplored frontier.
I came up with the following:
Public Class Main
Inherits System.Windows.Forms.Form
Class TabControl_Main
Public MyParent As New System.Windows.Forms.TabControl
Class TabPage_MapEditor
Public MyParent As New System.Windows.Forms.TabPage
WithEvents PictureBox_Map As New
System.Windows.Forms.PictureBox
End Class
End Class
[Subs & Functions]
End Class
How can I make it so that, from any procedure within Class Main, I can
refer to TabControl_Main's properties using *only*
TabControl_Main.MyParent, or PictureBox_Map's events and properties using
*only* TabControl_Main.TabPage_MapEditor.PictureBox_Map, with no more
generalized reference possible?
Am I even on the right track?