How do I "clone" a VB6 form [duplicate] - vb6

This question already has answers here:
How to add a form that is existing to a vb6 project?
(3 answers)
Closed 8 years ago.
I have opened a form, then clicked File-Save Form As, and given it a new name. But this just renames the existing form. I want to keep the existing form, but also have a copy with a different name.

VB6 does keep the original form -- on disk -- it just doesn't keep it in the project, so this should do it:
If you've made changes to the open file, you may want to save it in its current place, as this won't happen automatically when you save as.
Save the form as its new file name.
Also change the name of the form in the Properties window to match the new file name.
Do Project -> Add Form -> Existing and re-add the original file.

Well, I haven't had a running VB6 environment for almost a decade, but I think that all you have to do is to make a copy (from Windows Explorer or DOS command line) of your form's .FRM and .FRX files, save them with your new intended form name (the .FRM and .FRX must have the same name), and then use "Add Existing Form" in your Project menu to add it to your project.

Related

Prevent Xcode from opening new files

Is there any way to prevent Xcode from opening brand new files? Let me explain. Everytime I create a new file (Xib, .swift, .storyboard, etc...) Xcode opens that new file automatically in the standard editor. This functionality kinda annoys me because something I just want to create the file and maybe open it on the assistance editor instead or just to work on the file later. I tried changing some of the Xcode's behavior but I don't see any ways where I can trigger an action when certain events occur (like creating a new file).
Well here's one way:
Create a folder full of empty files of various types (with various extensions) that you typically create. Then whenenver you want a new file, rather than telling Xcode to create a new file, use the "Add Files to ..." command and choose one of those files. Just remember to also check the checkbox "Copy items if needed".
Doing this won't open the added file.
As an added benefit, you could also make some versions of these files pre-seeded with code or comments or whatever else that you often keep re-typing into many of your new files.

How can I create a new file in Xcode without adding it to any target?

Sometimes I just want to create a plain text file for storing JSON or whatever.
Normally I would just press cmdN to create a new file in Xcode. But it always adds the created file to the project! That means I need to delete it from the project every time!
I thought that this was because I checked the target that I want to add the file to here:
So I unchecked "TestingArea" and created the file. But it still adds the file to the project!
I know that I can use the TextEdit app, but since I have lots of apps placed on the Dock, finding it takes a long time.
Any solutions?

Why is it bad to edit the UIMap.designer.cs file in a Visual Studio Coded UI test?

I have read that it is bad to edit the UIMap.Designer.cs file, however, I do not understand why.
Per MSDN:
"Do not modify the UIMap.designer.cs file directly. If you do this, the changes to the file will be overwritten." http://msdn.microsoft.com/en-us/library/dd380782.aspx
Does anybody know what gets overwritten? Does this mean that if the UIMap.uitest file is edited after the Designer file, the designer file gets reversed? please help.
The UIMap.designer.cs file is regenerated from the UIMap.uitest file after every edit (that is saved) to the UIMap.uitest file. There is a comment at the top of the file saying that it is a generated file and that edits will be lost.
Large numbers of changes that, at first sight, appear to need editing of code in the designer file can be done by editing via the properties panels of the actions and UI-controls shown in the UIMap editor. Some changes do need manual editing. For these there is a command (button or right-click-menu) to move an action into the UIMap.cs file where it can be edited and extended as much as desired. Both of these UIMap...cs files specify partial in their class headers so both contribute to the same UIMap.
When just one action of a method needs manual editing it can be worth splitting that method into two or three pieces to place the action needing edits into its own method. The split command is available via a button or the right-click-menu. Having isolated the action, its method can be moved into the UIMap.cs file.
When moving methods and then editing them I recommend the following order of activity.
If needed: Split the method into pieces then rename the split methods using the UIMap editor. Save the UIMap.uitest file causing regeneration of the designer file. Then add calls to the split and renamed methods. Build the test and, perhaps, check that the test still works as expected.
Move method into the UIMap.cs file using the UIMap editor.
Save all files causing regeneration of the designer file. Omitting this save-all can cause confusing errors to be displayed on the C# files.
Edit the code just moved into the UIMap.cs file.
The UI Map editor is standard with Visual Studio 2012. For Visual Studio 2010 the editor was added by Feature Pack 2.
another option is to create another Class file for example, create Class1.CS and move all the code from UIMap.Designer.cs and UIMap.cs to Class1.cs. Now whenever you record anything, the regenerated code will be automatically generated in UIMap.Designer.cs file so just copy the same code to Class1.cs and change the code there if needed, and while running the main test just call this.Class1.launch(); it will run the codedTest.
It will also save you from splitting of methods in UIMap.uitest and then moving it to UIMap.cs
and even there will be a separate class including all your changes to the codedUItest.
Open the UIMap.uitest file in Visual Studio and click the 'Move code to UIMap.cs'
your function will move from designer.cs to UiMap.cs

SHBrowseForFolder text edit

I have some questions regarding SHBrowseForFolder(). I am using it with BIF_USENEWUI, BIF_RETURNONLYFSDIRS and BIF_VALIDATE. I am mainly having problems with the edit box. I'd like it to function a bit differently.
Let us assume, I am at a valid directory "C:\path". If I type in a non-existing folder (Let us call it "Folder1") into the textbox and then press OK, then the path I receive is "C:\path". Is there a way to have it so that when I press OK, it creates "Folder1" in "C:\path" and gives me the path "C:\path\Folder1"? (Without having to use the Make New Folder button)
Currently, I can click on "Make New Folder", which creates a new folder that I can rename. In the text edit, it appears as New Folder (its default name). After I rename the folder, it still appears as New Folder in the text edit, unless I click on another folder and then click back on the newly named folder. Is there a way for the text edit to be updated as soon as I rename the folder?
1 install an application-defined callback function and specify the BIF_VALIDATE flag, then handle BFFM_VALIDATEFAILED and try to create the folder there.
2 you can subclass the dialog and the text edit in BFFM_INITIALIZED and look for TVN_BEGINLABELEDIT and TVN_ENDLABELEDIT from the tree control, then change the text in the edit control based on the change to tree node text when the user finishes editing. The dialog id for controls on the browse folder dialog is not documented, so there is a compatibility risk you need to consider. I won't be surprised if your code breaks after a Windows update/upgrade, but as a user, this is not a feature I would miss anyway.

Programmatically rename an XCode project

I know one can rename a project by slowly double clicking the project name but I was wondering if it's possible to automate that through the command line (any language, possibly Apple Script) ?
Renaming an Xcode4 project is quite easy.
Click on Show the Project Manager to see the top level project file on the left side.
Click on the project name (here DeeTeeSaver will be changed to DeeTeeSaver2) in order to edit it and enter the new name.
It takes a second to let Xcode4 find out which parts have to be changed.
It then displays a dialog which parts will be changed. Simply click on Rename.
That´s it. No need to fondle around with AppleScript.
You might miss important parts inside the bundle.
Greetings from Switzerland, Ronald Hofmann
You will have to manipulate the .xcodeproj file, which is in XML format.
In my build process I have placeholder names that I simply search & replace with a command line app. If you need a generic solution you will have to parse the XML format (which is undocumented but not that hard to grasp).

Resources