Here is a step by step procedure on creating a custom optimizer (courtesy
Kurt Meister). An example Visual Studio solution is attached.
- Open Visual Studio (as Administrator)
- Click on File > New > Project > Windows Desktop > Class Library
- Change the Name to Example Optimizer and click OK
- In Solution Explorer, click on Example Optimizer
- Click on Project > Build > Output > Browse and navigate to main Wealth-Lab folder under Program Files (C:\Program Files\MS123\Wealth-Lab Developer 6\) and click Open
- Click on Debug and click on Start external program
- Click on ... and navigate to the folder above and click Select Folder
- In Solution Explorer, right click on Class1.cs > Rename and change it to ExampleOptimizer
- Click Yes in the message box that appears to rename all references
- In Solution Explorer, right click on References > Add Reference > Browse > Browse and navigate to the main WL folder (see Step 4) and click Add
- Click on Browse again, highlight WealthLab.dll and click Add
- Click OK
- In Solution Explorer, right click on Solution 'Example Optimizer' > Add > User Control > Visual C# Items > User Control
- Change the Name to Settings and click Add
- Settings.cs[Design] should be open and highlighted. If not, in Solution Explorer, double click on Settings.cs
- Click on View > Toolbox > Common Controls and double click on CheckBox
- Click on Settings.cs[Design] to hide the Toolbox
- Right click on checkBox1 > Properties
- Under Appearance > Checked, click on the dropdown and select True
- Under Appearance > Text, click on checkBox1, delete that and type Play Sound When Finished
- In Solution Explorer, expand Settings.cs and double click on Settings.Designer to open it
- At the bottom, change:
//private System.Windows.Forms.CheckBox checkbox1;
public System.Windows.Forms.CheckBox checkbox1;
- In Solution Explorer, right click on Solution 'Example Optimizer' > Add > User Control > Visual C# Items > User Control
- Change the Name to Tab and click Add
- Right click on checkBox1 > Properties
- Under Design > Modifiers, click on the dropdown and select Public
- Tab.cs[Design] should be open and highlighted. If not, in Solution Explorer, double click on Tab.cs
- Click on View > Toolbox > Common Controls and double click on TextBox
- Click on Tab.cs[Design] to hide the Toolbox
- Right click on textBox1 > Properties
- Under Design > Modifiers, click on the dropdown and select Public
- Click on View > Code
- Insert the following code:
public Tab(string putInTextBox1)
{
InitializeComponent();
textBox1.Text = putInTextBox1;
}
- In Solution Explorer, expand Tab.cs and double click on Tab.Designer to open it and change at the bottom:
//private System.Windows.Forms.TextBox textbox1;
public System.Windows.Forms.TextBox textbox1;
- Now all of your coding will be in Example Optimizer.cs