Re: Modular Programming...
Don,
As I mentioned, I find smaller routines are better. Rather then have one
long routine, I tend to have many smaller routines. With smaller routines in
most cases you will probably have better code reuse.
With smaller routines, you don't need to hide code within the routine
itself, using the options on the outlining menu, you can hide or unhide the
routine bodies...
Hope this helps
Jay
"I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
news:eCC8%236lm DHA.1408@TK2MSF TNGP11.phx.gbl. ..[color=blue]
> Thanks. I will use this "Region...E nd Region.." structure.
>
> Also, do you have any (similar) idea to hide/unhide the code within one
> procedure.
>
>
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in[/color]
message[color=blue]
> news:ui8wRqlmDH A.2000@TK2MSFTN GP12.phx.gbl...[color=green]
> > Don,
> > You can use #regions to group related handlers into collapsible sections[/color]
> of[color=green]
> > code.
> >
> > For example in the form I have open right now. I have
> >
> > #Region " File menu support "
> >
> > Private Sub menuFileClose_C lick(...) Handles menuFileClose.C lick
> > me.Close()
> > End Sub
> >
> > ...
> >
> > #End Region
> >
> > #Region " View menu support "
> > ...
> >
> > #End Region
> >
> > Where the first region has all the event handlers for the file menu,[/color][/color]
while[color=blue][color=green]
> > the second region has all the event handlers for the view menu.
> >
> > When I open the above form in Code view, both of the above sections are
> > collapsed by default. If I need to work on the File Menu I open that
> > section, if I need to work on the View menu I open that section.
> >
> > You could put your button click handlers into similar sections. Either a
> > single section, individual sections or grouped logically.
> >
> > Also, "Edit - Outlining" has a number of options to show or hide[/color][/color]
routines.[color=blue]
> I[color=green]
> > use "Collapse to Definitions" and "Toggle all Outlining" on the "Edit -
> > Outlining" routinely, to help find which routine I want to work on, then[/color][/color]
I[color=blue][color=green]
> > manually expand that one routine.
> >
> > Hope this helps
> > Jay
> >
> > "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
> > news:OjfkBflmDH A.1244@TK2MSFTN GP11.phx.gbl...[color=darkred]
> > > You wrote:
> > > ".............. You can use #region within your form's code to help[/color]
> > organize[color=darkred]
> > > the event handlers....."
> > >
> > > Could you tell me how it helps us to organize event handlers.
> > >
> > > Thanks!
> > >
> > >
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
Don,
As I mentioned, I find smaller routines are better. Rather then have one
long routine, I tend to have many smaller routines. With smaller routines in
most cases you will probably have better code reuse.
With smaller routines, you don't need to hide code within the routine
itself, using the options on the outlining menu, you can hide or unhide the
routine bodies...
Hope this helps
Jay
"I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
news:eCC8%236lm DHA.1408@TK2MSF TNGP11.phx.gbl. ..[color=blue]
> Thanks. I will use this "Region...E nd Region.." structure.
>
> Also, do you have any (similar) idea to hide/unhide the code within one
> procedure.
>
>
>
> "Jay B. Harlow [MVP - Outlook]" <Jay_Harlow@ema il.msn.com> wrote in[/color]
message[color=blue]
> news:ui8wRqlmDH A.2000@TK2MSFTN GP12.phx.gbl...[color=green]
> > Don,
> > You can use #regions to group related handlers into collapsible sections[/color]
> of[color=green]
> > code.
> >
> > For example in the form I have open right now. I have
> >
> > #Region " File menu support "
> >
> > Private Sub menuFileClose_C lick(...) Handles menuFileClose.C lick
> > me.Close()
> > End Sub
> >
> > ...
> >
> > #End Region
> >
> > #Region " View menu support "
> > ...
> >
> > #End Region
> >
> > Where the first region has all the event handlers for the file menu,[/color][/color]
while[color=blue][color=green]
> > the second region has all the event handlers for the view menu.
> >
> > When I open the above form in Code view, both of the above sections are
> > collapsed by default. If I need to work on the File Menu I open that
> > section, if I need to work on the View menu I open that section.
> >
> > You could put your button click handlers into similar sections. Either a
> > single section, individual sections or grouped logically.
> >
> > Also, "Edit - Outlining" has a number of options to show or hide[/color][/color]
routines.[color=blue]
> I[color=green]
> > use "Collapse to Definitions" and "Toggle all Outlining" on the "Edit -
> > Outlining" routinely, to help find which routine I want to work on, then[/color][/color]
I[color=blue][color=green]
> > manually expand that one routine.
> >
> > Hope this helps
> > Jay
> >
> > "I_AM_DON_AND_Y OU?" <user@domain.co m> wrote in message
> > news:OjfkBflmDH A.1244@TK2MSFTN GP11.phx.gbl...[color=darkred]
> > > You wrote:
> > > ".............. You can use #region within your form's code to help[/color]
> > organize[color=darkred]
> > > the event handlers....."
> > >
> > > Could you tell me how it helps us to organize event handlers.
> > >
> > > Thanks!
> > >
> > >
> > >
> > >
> > >[/color]
> >
> >[/color]
>
>[/color]
Comment