I want to put a label on my main form that I can use to write information on
to my Users.

In the Dialog resource editor, the closest I can find is a Static Text
control followed by an Edit Box control.

Is there a way to modify the text information on a Static Text control
during program execution?

I have tried doing this unsuccessfully before. Currently to draw text onto
the form, I get the rectangle of the window, calculate where I want my text
displayed, then use DrawText to place my information. This causes some
flickering that I would like to avoid by having a label on the form that I
can simply edit the text of.

What should I do here?

Again: Using eMbedded VC, not Visual Studio.

Thanks,
Joe

Re: Does it have a Label? by mmobile

mmobile
Wed Aug 08 11:37:51 CDT 2007

Joe,

Are you using MFC or Win32 APIs?

"jp2code" <poojo.com/mail> wrote in message
news:%23LfA5ed2HHA.4712@TK2MSFTNGP04.phx.gbl...
>I want to put a label on my main form that I can use to write information
>on to my Users.
>
> In the Dialog resource editor, the closest I can find is a Static Text
> control followed by an Edit Box control.
>
> Is there a way to modify the text information on a Static Text control
> during program execution?
>
> I have tried doing this unsuccessfully before. Currently to draw text onto
> the form, I get the rectangle of the window, calculate where I want my
> text displayed, then use DrawText to place my information. This causes
> some flickering that I would like to avoid by having a label on the form
> that I can simply edit the text of.
>
> What should I do here?
>
> Again: Using eMbedded VC, not Visual Studio.
>
> Thanks,
> Joe
>



Re: Does it have a Label? by jp2code

jp2code
Wed Aug 08 11:54:02 CDT 2007

MFC.

I'm searching the help right now for something like CLabel. That isn't
there, but there should be something!

"mmobile" asks:
> Joe,
>
> Are you using MFC or Win32 APIs?
>
> "jp2code" wrote:
>>I want to put a label on my main form that I can use to write information
>>on to my Users.
>>
>> In the Dialog resource editor, the closest I can find is a Static Text
>> control followed by an Edit Box control.
>>
>> Is there a way to modify the text information on a Static Text control
>> during program execution?
>>
>> I have tried doing this unsuccessfully before. Currently to draw text
>> onto the form, I get the rectangle of the window, calculate where I want
>> my text displayed, then use DrawText to place my information. This causes
>> some flickering that I would like to avoid by having a label on the form
>> that I can simply edit the text of.
>>
>> What should I do here?
>>
>> Again: Using eMbedded VC, not Visual Studio.
>>
>> Thanks,
>> Joe
>>
>
>



Re: Does it have a Label? by mmobile

mmobile
Wed Aug 08 13:03:12 CDT 2007

There is no CLabel, use the static text control and give it a unique ID e.g.
(IDC_MY_STATIC) & use the class wizard to create a CStatic member variable.
Then call the CStatic's SetWindowText function.

Or if you don't want to create a member variable you can call
((CStatic*)GetDlgItem(IDC_MY_STATIC))->SetWindowText(TEXT("Test"));

"jp2code" <poojo.com/mail> wrote in message
news:OE%23m3yd2HHA.1208@TK2MSFTNGP05.phx.gbl...
> MFC.
>
> I'm searching the help right now for something like CLabel. That isn't
> there, but there should be something!
>
> "mmobile" asks:
>> Joe,
>>
>> Are you using MFC or Win32 APIs?
>>
>> "jp2code" wrote:
>>>I want to put a label on my main form that I can use to write information
>>>on to my Users.
>>>
>>> In the Dialog resource editor, the closest I can find is a Static Text
>>> control followed by an Edit Box control.
>>>
>>> Is there a way to modify the text information on a Static Text control
>>> during program execution?
>>>
>>> I have tried doing this unsuccessfully before. Currently to draw text
>>> onto the form, I get the rectangle of the window, calculate where I want
>>> my text displayed, then use DrawText to place my information. This
>>> causes some flickering that I would like to avoid by having a label on
>>> the form that I can simply edit the text of.
>>>
>>> What should I do here?
>>>
>>> Again: Using eMbedded VC, not Visual Studio.
>>>
>>> Thanks,
>>> Joe
>>>
>>
>>
>
>



Re: Does it have a Label? by jp2code

jp2code
Wed Aug 08 13:47:44 CDT 2007

Great - Thanks for the help!

"mmobile" wrote:
> There is no CLabel, use the static text control and give it a unique ID
> e.g. (IDC_MY_STATIC) & use the class wizard to create a CStatic member
> variable. Then call the CStatic's SetWindowText function.
>
> Or if you don't want to create a member variable you can call
> ((CStatic*)GetDlgItem(IDC_MY_STATIC))->SetWindowText(TEXT("Test"));
>



Re: eVC4: Does it have a Label? by r_z_aret

r_z_aret
Wed Aug 08 15:43:56 CDT 2007

On Wed, 8 Aug 2007 11:18:17 -0500, "jp2code" <poojo.com/mail> wrote:

>I want to put a label on my main form that I can use to write information on
>to my Users.
>
>In the Dialog resource editor, the closest I can find is a Static Text
>control followed by an Edit Box control.
>
>Is there a way to modify the text information on a Static Text control
>during program execution?

When I want to change text on a static control, I use the
SetWindowText function.

My apps are all dialog, not form, based. But SetWindowText sets the
caption for my dialogs, so it might work for forms.

>
>I have tried doing this unsuccessfully before. Currently to draw text onto
>the form, I get the rectangle of the window, calculate where I want my text
>displayed, then use DrawText to place my information. This causes some
>flickering that I would like to avoid by having a label on the form that I
>can simply edit the text of.
>
>What should I do here?
>
>Again: Using eMbedded VC, not Visual Studio.

SetWindowText is part of Win32, so I can use it with eVC and VC and
without MFC.


>Thanks,
>Joe
>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
20 Park Plaza, Suite 478
Boston, MA 02116
www.penfact.com