I'm implementing a Windows application in C# .Net 2.0. On many
of the forms I need to have record navigation capabilities
(forwards, backwards, first, last etc) which I chose a to do
with a toolbar containg 7 buttons or so.

1. Rather than recreating the same toolbar (navBar) in the dozen
or so locations I need it, is this a case where I could use
the UserControl?

2. Regardless, is it a simple matter to make the UserControl
accessible in the forms design mode?

Thanks,

- Jamie

Re: UserControl purpose question ... by AlexS

AlexS
Fri Jun 01 09:32:17 CDT 2007

In this case easier way is to subclass form with toolbar.

Suppose you create form with toolbar ToolForm. Derive your other forms from
it.

class MyNewForm : ToolForm {
...
}

You might need to add properties to ToolForm to get to events for toolbar
buttons, but it should not cause any difficulties.

UserControl itself is placeholder where you put additional controls. Then
you should put it on corresponding form. Slightly more and unnecessarily
complex for your case and with design hassles (positioning, attaching events
etc.).

HTH
Alex

"Jamie Risk" <risk.#.@intectus.com> wrote in message
news:OGAMDiFpHHA.1240@TK2MSFTNGP06.phx.gbl...
> I'm implementing a Windows application in C# .Net 2.0. On many of the
> forms I need to have record navigation capabilities (forwards, backwards,
> first, last etc) which I chose a to do with a toolbar containg 7 buttons
> or so.
>
> 1. Rather than recreating the same toolbar (navBar) in the dozen
> or so locations I need it, is this a case where I could use
> the UserControl?
>
> 2. Regardless, is it a simple matter to make the UserControl
> accessible in the forms design mode?
>
> Thanks,
>
> - Jamie