I've run into a particularly annoying issue when cutting and pasting controls from one form to another.
On the first form, I selected several text boxes and command buttons, opened the right click menu, and selected Cut. I then switched to the second form, right clicked, then selected Paste.
To my dismay, all the controls had their "Name" property reset. Before the Cut, they all had names like txtLastName, txtFirstName, txtAddress, etc. After the Paste, they became Text1, Text2, Text3, etc.
Is this expected behaviour? It set me back a good 10-15 minutes to retype the proper control names. I remember years ago in VB6 doing this kind of action, and properties for all the controls were maintained.
Hi Dan,
When I wrote the cut/copy/paste code for controls I set it so that the names would be generic on the paste, hence the Text1, Text2, etc... I could certainly change that behaviour if the user base would prefer the original names to be retained.....it does seem to make more sense to retain the names.
Paul,
I like the idea of retaining the names, but if you were pasting to the same form, you would need to append a suffix to differentiate between the controls. Maybe it already works this way.....I haven't tried it.
My .02
Gary
Maybe add a third ccp item or a popup where you have options.
Or maybe if you're cutting, names should be retained and with copy no. Just make sure you don't save the form you're cutting from if you want to retain the original.
James
After using FireFly for most of the day today, I think it makes sense to retain the names when doing a cut/copy and pasting on to a different form. And like Gary mentioned above, if copying/pasting to the same form, obviously changing the names so they don't conflict with the originals would be a good idea.
Ok, I just tried pasting a control on the same form and the property name is different from the original...for instance, copying and pasting a textbox (Text1) ends up being pasted as (Text2). If possible, it might be handy to have the text property also match the name property, so that when the textbox gets pasted, the name is Text2 and also text or caption is Text2.
Thanks,
Gary
I like the idea mentioned above of keeping names if a different form and the way it works now for same form. Also, if you change the object after copy and before pasting it still pastes the original at the time of copy, so it is possible to rename and could allow pasting with same name. Perhaps if it doesn't exist keep the name, otherwise use the generic forms with the prefix. There is obviously already code to check existing since I can rename and it cycles from 1-x for numbers available.
This change has now been implemented. The fix will be in the next update (version 3.08).