Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2007

Tip: Looking for answers? Try searching our database.

UserControl purpose question ...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jamie Risk - 01 Jun 2007 15:24 GMT
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
AlexS - 01 Jun 2007 15:32 GMT
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

> 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,
[quoted text clipped - 11 lines]
>
> - Jamie

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.