Community
Showing results for 
Search instead for 
Do you mean 
Reply

Accessing a control?

New Member
Posts: 9
Country: USA

Accessing a control?

Is there a way to access a specific control (like a text box) on the Contact detail view?  Specifically, I need to mask the displayed value for a custom field on the layout view.

Employee
Posts: 1,163
Country: USA

Re: Accessing a control?

We can monitor that particular field for changes, get the value from the field once the change as occurred and modify it if need be.

 

This thread may be helpful.

Matthew Wood
Act! SDK Support
Community Moderator
New Member
Posts: 9
Country: USA

Re: Accessing a control?

I am currently monitoring for field changes, but that doesn't really help in this situation.  The user wants to mask the contents of the control as displayed to the user (let's say he wants to display with the **** password character mask), but I can't figure out how to get to the actual control itself rather than the Contact field.

 

Basically he requires an authorization code to be entered into a custom field before certain actions can be taken on a contact.  I've got the authorization code field secured so that only 2 specific users can enter those values, but he wants to actually mask the code from the end user for some reason (not sure why, since nobody else can enter the values).

Bronze Super Contributor
Posts: 1,231
Country: USA

Re: Accessing a control?

ACT! uses multiple controls in its control the user drags onto the form. This is how when the users change the field type the control will set the visible the type of conrol needed such as Date, text boxes and drop downs.

 

To change the password find the conrol then find the text box inside the control.

Change the text box password character field in the control.

This is sudo code:

 

For Each c As Object ACTView

 If Not TypeDescriptor.GetProperties(CType(c, Object))("FieldDescriptor") IsNothingThen

   For Each Ctr As Control In c.Controls

    IfTypeOf Ctr Is TextBox Then

        if CType(uictrl, Object).FieldDescriptor.DisplayName = "MyFieldName"

         DirectCast(Ctr, TextBox).PasswordChar = "*"

        EndIf

      EndIf

   Next

EndIf

Next

 

Hope this helps

 

-- Jim Durkin

New Member
Posts: 9
Country: USA

Re: Accessing a control?

What is ACTView in your sample code?  I'm currently accessing the view with the IView object, but I'm not seeing a Controls collection.  Also, is there a more efficient way to access a control directly rather than looping through every object within a view?