×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    108

    Question Text Color of button

    Hi ,
    I need to change the text color of a generic button.
    How do I do this..?

    remesh

  2. #2
    Nokia Developer Champion
    Join Date
    Jan 2008
    Location
    Moscow, Russia
    Posts
    3,348

    Re: Text Color of button

    Try to use this function - CAknButton::SetTextColorIds ( const TAknsItemID & aTextColorTableId, const TInt aTextColorIndex )

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    108

    Question Re: Text Color of button

    Thank u for u r quick reply,

    I am still not able to change the color of the text.

    Following is the code that I tried:-

    Code:
    _LIT(KHelpText,"");
    	
    	_LIT(KFirstButtonText,"Play");
    
    	iFirstButton = CAknButton::NewL(NULL, NULL, NULL, NULL, KFirstButtonText,
    			KHelpText, 0, 0);
    	iFirstButton->SetContainerWindowL(*this);
    	iFirstButton->SetRect(TRect(TPoint(105, 50), TSize(150, 100)));
    	
    
            //////////////////////////////////
            TAknsItemID skinItemId;
    	skinItemId.iMinor = EAknsMinorQsnTextColors;
    	skinItemId.iMajor = EAknsMajorSkin;
            iFirstButton->SetTextColorIds(skinItemId, KRgbBlue.Value());
           //////////////////////////////////
    
    	const CFont* pFont = AknLayoutUtils::FontFromId(
    			EAknLogicalFontSecondaryFont);
    	TFontSpec fontSpec = pFont->FontSpecInTwips();
    	fontSpec.iHeight = 50; // Your desired height
    	iFirstButton->SetTextFont(pFont);
    	iFirstButton->MakeVisible(ETrue);
    	iFirstButton->ActivateL();
    anything wrong with this...?

    remesh

  4. #4
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    108

    Re: Text Color of button

    Hi,
    I solved this problem by using OverrideColorL() method.

    remesh

  5. #5
    Registered User
    Join Date
    Feb 2011
    Posts
    338

    Re: Text Color of button

    remesh,
    I used OverrideColorL() method. But no effect. How did you do that?
    Thank you.

  6. #6
    Registered User
    Join Date
    Dec 2009
    Posts
    339

    Re: Text Color of button

    what parameters you are sending to OverrideColorL( ) method. you can try with that
    Code:
    OverrideColorL(EColorButtonText, KRgbBlue)
    Replace KRgbBlue with your color.

Similar Threads

  1. How to append text in a text file in j2me
    By lovely_334801 in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-04-26, 11:10
  2. how to display text box on the press of ok button in series 60
    By pravesh99_sw in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-01-24, 14:40
  3. CRichText text problem
    By introuble in forum Symbian User Interface
    Replies: 2
    Last Post: 2003-09-30, 17:29
  4. Clearing Label Text
    By tejinderka in forum Symbian
    Replies: 3
    Last Post: 2003-09-19, 10:53

Posting Permissions

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