winform shared user controls basics

winform shared user controls basics

Old forum URL: forums.lhotka.net/forums/t/208.aspx


HappyJack posted on Friday, May 26, 2006

I'm using the CSLA Framework to create all my classes and it has been great. I'm at the point now where I need to display these classes in 2 separate winform applications. Since both application are going to be displaying the data the same why I decided to create a usercontrol to wrap up some of the functionality. Let's say for example I have a list of my top 50 best customers. I want to show these customers in a gird with just name and email in a navigation pane similar to outlook. This is really easy to do and I have this working. The question that I have is what is the best way to customize the context menu or actions that can be performed from this list of customers? In 1 app you may be able to add a customer to this list and in the other app you are just using the list to select a customer. I have been think about adding a custom event for beforepopup that each app could catch and then modify the context menu as need. This would give the flexibility to override the menu differently depending on the item that you are clicked on for each app that is using the custom user control. Another option in this case would be to just use the contextmenu property of the usercontrol and set that from each application.

Thanks,

HappyJack

Copyright (c) Marimer LLC