×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    15

    Setting control text

    Hi I have a question about how to set the text of a control in a dialog-form. I have several variables that i want to set to their respective control at startup of a new form. The form I use is derived from CAknForm.

    Hope that someone can give me a tip or advise

    /Per

  2. #2
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    194

    RE: Setting control text

    For all those controls which need to have dynamic text changes:
    1. Define objects of type CEikLabel:
    iLabel=new (ELeave) CEikLabel;
    2. Call CEikLabel::SetContainerWindowL() to set the component controls' container window:
    iLabel->SetContainerWindowL(*this);
    3. Call CEikLabel::SetTextL() to set the text
    iLabel2->SetTextL(_L("Your Label text"));
    4. Redraw the application view to the screen:
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(Rect());

    Nani

Posting Permissions

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