469,326 Members | 1,241 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

Nested Control Declarations (using Classes, perhaps?)

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?
Feb 11 '06 #1
0 760

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by chad | last post: by
9 posts views Thread by OKB (not okblacke) | last post: by
3 posts views Thread by Erik Bongers | last post: by
3 posts views Thread by Rubén Campos | last post: by
2 posts views Thread by Alfonso Morra | last post: by
6 posts views Thread by B0nj | last post: by
8 posts views Thread by Robert W. | last post: by
9 posts views Thread by Javaman59 | last post: by
5 posts views Thread by Jake K | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by listenups61195 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.