Community
Showing results for 
Search instead for 
Do you mean 
Reply

Custom Controls

Nickel Super Contributor
Posts: 441
Country: UK

Custom Controls

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?

 

TIA

 

Tom

Copper Super Contributor
Posts: 59
Country: USA

Re: Custom Controls

[ Edited ]

Hi Tom,

 

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. 

Message Edited by hugovale on 08-10-2009 02:55 PM
Hugo Vale
Datastream Custom Solutions
http://www.datastreamcs.com
Bronze Elite Contributor
Posts: 2,115
Country: United_Kingdom

Re: Custom Controls

Hi Tom,

 

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.

 

Vivek 

 

 

 

Vivek Gargav
Caldere Associates Ltd.
www.caldere.com
vgargav@caldere.com
My Blog
Nickel Super Contributor
Posts: 441
Country: UK

Re: Custom Controls

Thanks guys this is a big help Smiley Happy

 

Tom