×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    111

    Change CAknButton text

    Hi,

    How to change CAknButton text ?

    Thanks.

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Change CAknButton text

    Try this out:

    void CAknButtonState::SetTextL ( const TDesC & aText )

    http://wiki.forum.nokia.com/index.ph...-_S60_Touch_UI
    Regards,
    Shafali

  3. #3
    Regular Contributor
    Join Date
    May 2007
    Location
    India
    Posts
    136

    Re: Change CAknButton text

    Hi,

    I have tried to get the button text using CAknButtonState::Text() on button down event. But when i show the text in AlertWin(), it is just junk characters. Following is the code used by sample application.

    CAknButtonState* lButtonState = iFirstButton->State(); //iFirstButton is CAknButton pointer
    TDesC lText = lButtonState->Text();
    TBuf<32> lBuffer;
    lBuffer.Copy( lText );
    CEikonEnv::Static()->AlertWin( lBuffer );

    What is going wrong in the above code while getting the button text?


    Thanks
    Rajat

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Change CAknButton text

    Quote Originally Posted by raj_rr7 View Post
    Hi,

    I have tried to get the button text using CAknButtonState::Text() on button down event. But when i show the text in AlertWin(), it is just junk characters. Following is the code used by sample application.

    CAknButtonState* lButtonState = iFirstButton->State(); //iFirstButton is CAknButton pointer
    TDesC lText = lButtonState->Text();
    TBuf<32> lBuffer;
    lBuffer.Copy( lText );
    CEikonEnv::Static()->AlertWin( lBuffer );

    What is going wrong in the above code while getting the button text?


    Thanks
    Rajat
    Try something like this:
    TBuf<32> lBuffer = lButtonState->Text();

    lBuffer.Copy( lText );
    CEikonEnv::Static()->AlertWin( lBuffer );
    Regards,
    Shafali

Similar Threads

  1. Change Selected text hbackground color
    By rakesh.jaiswal in forum General Development Questions
    Replies: 2
    Last Post: 2009-05-26, 13:51
  2. Change Carbide-Generated Navi Pane Text at runtime
    By tamhanna in forum Symbian User Interface
    Replies: 3
    Last Post: 2009-02-22, 01:25
  3. Replies: 0
    Last Post: 2008-09-18, 08:30
  4. Replies: 1
    Last Post: 2008-07-25, 14:41
  5. How to change Grid Selected Text Item?
    By ardc_21 in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-06-29, 09:15

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×