Changing the caption property on a label at run time 
Author Message
 Changing the caption property on a label at run time

Quote:

>Could some one help me with this,
>I am tring to change the caption of a label at run time, via an input box.
>This I have been able to do buy using the code,
>  Label14.Caption = InputBox("Enter new heading:", "Change Heading")

>What is happening is that when I exit the program and re-enter it the
>caption of the label is changed back to it setting at design time,
>e.g.
>at design time I set the caption to 'Other', then I changed it to 'Phone'
at
>run time. and then when I exit the program and restart it the caption has
>changed to 'Other'.

>Is there a way in which I can change the caption in run time and it will
>remain changed always, with out having to save the new caption to a
database
>table.

>Thanks for you help
>Andrew Brown



Fri, 16 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time

Quote:
>>Is there a way in which I can change the caption in run time and it will
>>remain changed always, with out having to save the new caption to a
>database
>>table.

No, there isn't! Changing the caption of the lable won't patch the EXE-File!

Ralph



Fri, 16 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
Quote:


> >Could some one help me with this,
> >I am tring to change the caption of a label at run time, via an input box.
> >This I have been able to do buy using the code,
> >  Label14.Caption = InputBox("Enter new heading:", "Change Heading")

> >What is happening is that when I exit the program and re-enter it the
> >caption of the label is changed back to it setting at design time,
> >e.g.
> >at design time I set the caption to 'Other', then I changed it to 'Phone'
> at
> >run time. and then when I exit the program and restart it the caption has
> >changed to 'Other'.

> >Is there a way in which I can change the caption in run time and it will
> >remain changed always, with out having to save the new caption to a
> database
> >table.

> >Thanks for you help
> >Andrew Brown

You could keep the new caption name in an ini-file or even better in the
registry. At the start of your program you read these values and set the
captions.

Karin



Fri, 16 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time

Quote:


>>Could some one help me with this,
>>I am tring to change the caption of a label at run time, via an input box.
>>This I have been able to do buy using the code,
>>  Label14.Caption = InputBox("Enter new heading:", "Change Heading")

>>What is happening is that when I exit the program and re-enter it the
>>caption of the label is changed back to it setting at design time,
>>e.g.
>>at design time I set the caption to 'Other', then I changed it to 'Phone'
>at
>>run time. and then when I exit the program and restart it the caption has
>>changed to 'Other'.

>>Is there a way in which I can change the caption in run time and it will
>>remain changed always, with out having to save the new caption to a
>database
>>table.

You may write the new caption to a txt-file, an ini-file or to the
registry.
You have to read and set it on every program start!

Normaly this is done with the registry!

HTH

Rainer

--

PGP 5.0 Public Key. Send Mail with Subject: SendPublicKey

"M?gest Du verflucht sein, in einer interessanten Zeit zu leben" - Konfuzius



Fri, 16 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
Sorry if I'm off topic, this is the only message in the thread to show up on
my side.

AFAIK, changing the Label caption has nothing to do with the EXE file.  Yes,
you're right that in order to make the change persistent, one must either
open the form in design mode and save the changes, or if the number of
labels being affected by this behavior is limited, then one might try custom
properties to store the value.

If there are several possible choices, then storing the captions in a table
and assigning them at run time is probably the best alternative.

HTH
--
Dev Ashish (Just my $.001)
---------------
The Access Web ( http://home.att.net/~dashish )
---------------

:>>Is there a way in which I can change the caption in run time and it will
:>>remain changed always, with out having to save the new caption to a
:>database
:>>table.
:
:
:No, there isn't! Changing the caption of the lable won't patch the
EXE-File!
:
:Ralph
:
:



Fri, 16 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
I dont know if it possible, but one might consider writing the changed label
to a resource file..................(as long as you know the Tag!)

Quote:

>Sorry if I'm off topic, this is the only message in the thread to show up
on
>my side.

>AFAIK, changing the Label caption has nothing to do with the EXE file.
Yes,
>you're right that in order to make the change persistent, one must either
>open the form in design mode and save the changes, or if the number of
>labels being affected by this behavior is limited, then one might try
custom
>properties to store the value.

>If there are several possible choices, then storing the captions in a table
>and assigning them at run time is probably the best alternative.

>HTH
>--
>Dev Ashish (Just my $.001)
>---------------
>The Access Web ( http://home.att.net/~dashish )
>---------------


>:>>Is there a way in which I can change the caption in run time and it will
>:>>remain changed always, with out having to save the new caption to a
>:>database
>:>>table.
>:
>:
>:No, there isn't! Changing the caption of the lable won't patch the
>EXE-File!
>:
>:Ralph
>:
>:



Tue, 27 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
GENTLEMEN PLEASE THIS IS A SPANISH FORUM!!!!


Fri, 30 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time

Quote:

>GENTLEMEN PLEASE THIS IS A SPANISH FORUM!!!!

Como?


Sat, 31 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
Someone who doesn't bother ro check how widely the message was cross-posted
before jumping in.

Obviously doesn't know it's rude to shout either.


Quote:


>>GENTLEMEN PLEASE THIS IS A SPANISH FORUM!!!!

>Como?



Sat, 31 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time

Terry Kreft escribi en mensaje ...

Quote:
>Someone who doesn't bother ro check how widely the message was cross-posted
>before jumping in.

>Obviously doesn't know it's rude to shout either.

This can be avoided if the sender analizes where is sending the message.

+---?Saludos desde Mxico!--+
|   .+'~~'+.                |
|   * Tron *    David.BAS   |
|   `+,__,+'                |
+---------------------------+
 http://spin.com.mx/~adgarza



Sat, 31 Mar 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
Can someone detail to me the problem from scratch?  I have a good idea that
I've done this in an application but need to know exactly what you want to
do.
Responses by email preferred

Quote:

>I dont know if it possible, but one might consider writing the changed
label
>to a resource file..................(as long as you know the Tag!)


>>Sorry if I'm off topic, this is the only message in the thread to show up
>on
>>my side.

>>AFAIK, changing the Label caption has nothing to do with the EXE file.
>Yes,
>>you're right that in order to make the change persistent, one must either
>>open the form in design mode and save the changes, or if the number of
>>labels being affected by this behavior is limited, then one might try
>custom
>>properties to store the value.

>>If there are several possible choices, then storing the captions in a
table
>>and assigning them at run time is probably the best alternative.

>>HTH
>>--
>>Dev Ashish (Just my $.001)
>>---------------
>>The Access Web ( http://home.att.net/~dashish )
>>---------------


>>:>>Is there a way in which I can change the caption in run time and it
will
>>:>>remain changed always, with out having to save the new caption to a
>>:>database
>>:>>table.
>>:
>>:
>>:No, there isn't! Changing the caption of the lable won't patch the
>>EXE-File!
>>:
>>:Ralph
>>:
>>:



Tue, 03 Apr 2001 03:00:00 GMT  
 Changing the caption property on a label at run time
An application I am currently writing has, rather than a resource file, a
text file containing the names of all captionable object names on each
form - under a form heading.  Makes it easier to produce international and
user-customisable applications.  It seemed to be a little more logical than
using and trying to remember tags in a *.res or *.rc file.

For example - the application reads in the following from a text file:

[formname]
labelProductCode=Product Code

When a change has occurred in the label, firstly change the caption at
runtime - myobject.caption = "NewCaption", and write the changed caption
into the text file.  Next time the form is opened the caption will again be
read from the textfile.

This method also allows users to change their own labels through the text
file

Quote:

>I dont know if it possible, but one might consider writing the changed
label
>to a resource file..................(as long as you know the Tag!)



Fri, 06 Apr 2001 03:00:00 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. Changing the caption property on a label at run time

2. Changing the caption property on a label at run time

3. How to change a Label caption on run time

4. Changing cmdButton.caption property at run time

5. Help: VB6 Data Report - Assign Run-time Label Caption

6. Help: VB6 Data Report - Assign Run-time Label Caption

7. Changing label captions while running code

8. Help needed with changing captions during run time

9. Change label caption in userform on change of dropdown listbox

10. Label Caption Doesn't Change When Changed

11. Change Label Font at run time

12. Q: Color of labels changes at run time.

 

 
Powered by phpBB® Forum Software