08-10-2009 09:39 AM
I would like to create a custom control to sit on a company view and to display data based on a value I will calculate from another field. Note sure where to start as far as creating cutsom controls, there are samples for creating a contactListBound control in the SDK but this isn't what I need. Does anyone have a very basic sample of how to create a custom control and ideally grab a reference to the current act application object?
08-10-2009 02:52 PM - edited 08-10-2009 02:55 PM
I don't remember the sdk sample very well, but I do know that it helped me a lot to figure this out. Basically you need to implement the interface IContactListBoundControl. This interface implements a property called ContactListComponent. This property is where you can get the ActFramework object.
actFW = ContactListComponent.FrameworkComponent.Framework
To get the ActApplication object at any point, you can just use the following:
Dim ActApp as Act.UI.ActApplication = Act.UI.ActApplication.Instance
This will return the currently open ACT instance.
08-11-2009 12:47 AM
I've been playing around with Custom controls for a very short time so I appologise now if I get anything wrong! I have not been able to find a straight forward and simple procedure to access the ActApplication object and I dont think that the designer makes it available. The only way I have been able to access certain ActApp objects has been via the CurrencyManager so something like:
//private CurrencyManager manager;Contact currentCont = manager.Current as Contact;
this then allows further code like:
//private ContactFieldDescriptor field;MessageBox.Show(field.GetValue(currentCont).ToString());
Hopefully that makes some sense to you! PM me and I can send you a zip of a test sln file I have done with a working control.