UserControl purpose question ...

J

Jamie Risk

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
 
A

AlexS

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top