Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

Change softkeys dynamically (either right or left or both)

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: rathodavinash (19 May 2007)
Last edited: hamishwillee (30 May 2013)

The article shows how Softkeys (not CBA) can be changed dynamically. Either left or right or both can be changed.

Changing right softkey

Cba()->RemoveCommandFromStack(2, EBack);
Cba()->AddCommandToStackL(2,ECancel,_L("Cancel"));
Cba()->DrawDeferred();

So instead of handling EBack in HandleCommandL ECancel will be handled.

Similarly the left softkey can be changed by

Cba()->RemoveCommandFromStack(0, ESave);
Cba()->AddCommandToStackL(0,EOk,_L("Ok"));
Cba()->DrawDeferred();

Just remember

  • 0 - Left softkey
  • 2 - Right softkey
  • Header File - #include <eikbtgpc.h>
  • Link against - eikcoctl.lib


And you can also try this code for changing softkeys

Cba()->SetCommandL(0, EAknSoftkeyOk, _L("Ok"));
Cba()->DrawDeferred();
This page was last modified on 30 May 2013, at 04:32.
44 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×