Changing help text on text field after event

213 Views Asked by At

When a credential provider is selected, the system calls ICredentialProvier::GetFieldDescriptorAt(...) to get information about the field. For text fields, you can initialize the background/help text of the field with things like "Username" or "Password" or whatever. We have a field where we'd like to change the background/help text dynamically based up interaction of another field (a checkbox). I can trap the event no problem, however, I cannot change the background text of the text field. If I call ICredentialProviderCredentialEvents::SetFieldString(...), it sets the text within the field itself. I don't want to change that text, I just want to change the background/help text in the text field? Is there any trick to doing this? I can't say I've seen any.

So, I want a way to

  1. change the background/help text of a text field dynamically, or
  2. force a call to GetFieldDescriptorAt() to repopulate

I haven't found a way to do either of those two things. The only possible thought is to have two separate fields that toggle visibility, but it's more risk than what I'm wont to do at this point.

1

There are 1 best solutions below

3
On

Your provider has been already called for ICredentialProvider::Advise method. The first parameter is credential notification event handler interfaceICredentialProviderEvents pointer. The second one is cookie.

Now you can call CredentialsChanged method of ICredentialProviderEvents interface with the cookie provided to your provider in the above call.

As a response your provider will be called for ICredentialProvider::GetFieldDescriptorCount and ICredentialProvider::GetFieldDescriptorAt methods.