×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2012
    Posts
    5

    How to set background of label?

    Hello,
    I tried many things with setting Emphasis and overriding color of EColorControlBackground but none seem to work. So how I can change the background of label?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: How to set background of label?

    easiest way would propably be not using labels, instead you could simply use Drawtext function from Gc, then you could use any brush patterns (or just transparenc background) with text drawing. You could also make your own custom Label with CCoeControl, incase you really want to do it that way..

  3. #3
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,689

    Re: How to set background of label?

    Strange, based on http://www.developer.nokia.com/Commu...ymbian_C%2B%2B or http://www.developer.nokia.com/Commu..._use_CEikLabel, I would assume they work. Or at least worked some time ago.
    Which device or emulator do you test with?

  4. #4
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: How to set background of label?

    paste here the piece of code which you tried.

  5. #5
    Registered User
    Join Date
    Sep 2012
    Posts
    5

    Re: How to set background of label?

    tried every combination of those...
    label->OverrideColorL( EColorLabelText, KRgbWhite);
    label->OverrideColorL(EColorControlBackground, KRgbWhite);
    label->OverrideColorL( EColorLabelHighlightFullEmphasis, KRgbRed );
    label->SetEmphasis( CEikLabel::EFullEmphasis);
    label->SetEmphasis( CEikLabel::EPartialEmphasis);

    on device:
    S60 3rd edition emulator

  6. #6
    Nokia Developer Champion
    Join Date
    May 2004
    Posts
    2,267

    Re: How to set background of label?

    The code below works for me on S60 3rd Edition emulator.

    Code:
        ...
    		iLabel1->SetEmphasis( CEikLabel::EFullEmphasis);
    		iLabel1->OverrideColorL( EColorLabelHighlightFullEmphasis, KRgbRed ); // red background
    		iLabel1->OverrideColorL( EColorLabelTextEmphasis, KRgbBlue ); // and blue text
       ...
    BR/Ziteng

Similar Threads

  1. on device N-97 background image get disappear or get black background
    By amitsharma_ujj in forum [Archived] Qt Mobility Project
    Replies: 13
    Last Post: 2011-05-06, 08:05
  2. Replies: 11
    Last Post: 2008-03-28, 08:58
  3. how to create a label with semi-transparent background?
    By falafala in forum Symbian User Interface
    Replies: 5
    Last Post: 2008-03-25, 10:45
  4. Dialog with label background problem
    By erst in forum Symbian User Interface
    Replies: 0
    Last Post: 2007-12-06, 19:02
  5. how to get background color of a label
    By anupid in forum Symbian User Interface
    Replies: 4
    Last Post: 2007-02-02, 06:32

Posting Permissions

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