Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Rename form object at run-time while form is in use?
Message
De
28/08/2001 12:10:39
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00549854
Message ID:
00549889
Vues:
14
Vlad,
I didn't get 2nd step. You could just do plain renaming as far as you keep names unique. ie:
with thisform.SomeContainer
 .txt1.Name = 'txt3'
 .txt2.Name = 'txt1'
 .addobject('txt2','textbox')
endwith
Is legal.
Cetin

>Hi!
>
>Is it not that easy to put all these controls into 2 containers. So when you need to use one set of controls, you just rename only one object - the container?
>
>The renaming algorithm should be following:
>
>1. Lock the scread if it is not already locked.
>2. Make both containers (or sets of controls) not visible by setting their Visible property to .F. This is required, because VFP will not allow to rename the "Text3" to "Text1" when "Text1" just was here on form and just renamed to something else in the same code snippet. "Text1" will still be on the form as soon as it is visible even when you rename it disalowing to add anotehr object with similar name.
>3. Change name of the main set of controls used for work to something predefined temporary, say, TXT_TEMPTEXT*.
>4. Change the txtTextBox* for not shown controls set to required names.
>5. Change the temporary names to the names that were before for not shown set.
>6. Make controls visible.
>7. Unlock the screen if it was locked in this procedure
>
>HTH.
>
>>I have a form with a bunch of textboxes layed-out kind of like a spreadsheet. Don't ask me why they didn't use a grid. I am modifying an existing form.
>>
>>On my form I have for example -
>>
>>Name = txtMyTextbox1, ControlSource = Person1
>>Name = txtMyTextbox2, ControlSource = Person2
>>
>>And a command button -
>>THISFORM.txtMyTextbox1.ControlSource = Person1
>>THISFORM.txtMyTextbox2.ControlSource = Person2
>>THISFORM.Refresh
>>
>>What I want to do is have another command button that does the following -
>>THISFORM.txtMyTextbox3.ControlSource = Person3
>>THISFORM.txtMyTextbox4.ControlSource = Person4
>>THISFORM.Refresh
>>
>>But I want to rename txtMyTextbox1 to txtMyTextbox3 and also rename the ControlSource from Person1 to Person3. Like-wise for txtMyTextbox2. How can you rename the name of the objects when the form is already displayed using the command buttons to switch the objects names back and forth between two different sets of names?
>>
>>TIA!!!
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform