Wealth-Lab Version 5 (.NET) 5.0
Hello
I have created a simple Windows Form with a Listview embedded on it. I would like to use this as a data grid by inserting data into it via a strategy script.
The form is created in the strategy's constructor. If the Show() method is executed in the constructor, the form is shown normally. However any additional methods that need to be called for data insertion in the Execute() method of the strategy are not executed or are not working.
When Show() is executed inside the strategy's Execute() method, the form is shown for an instant then destroyed.
Is there a guideline for using Windows Forms in WL 5.0?
I understand that this is an advanced topic but any help from the WL5 developer crew is greatly appreciated.
Regards
Size:
Color:
<< Is there a guideline for using Windows Forms in WL 5.0? >>
Think .NET, not "Wealth-Lab". When you want a modal form, then you have to specify that.
Size:
Color:
Thanks, Cone. ShowDialog displays the form but completely blocks WL until it is closed. Show() displays the form but soon it disappears. Showing the form in the modeless form is most desirable. I will see if somehow setting its parent to WL will achieve the desired result.
Thanks again.
Size:
Color:
Svrz have you ever tried to create application with several windows Forms? if yes you can do same technic for WL.
If no you can use this thing:
for each form create new thread, like this:
CODE:
Please log in to see this code.
in this case new form will not block WL and will work in parallel, but some times you will have problem with transfer parameters from Slave thread to WL. For resolve this problem i changed class SlaveForm:
1. add reference on masterClass (this is which you use in WL, look like - public class MasterClass: WealthScript)
in class with your Windows Form variable:
private masterClass Parent;
2. in the constructor Form:
SlaveForm(masterClass X)
{ Parent = X;
....//what ever you wish
}
3. For use WL function use expressions like:
Parent.BuyAtLimit(...);
you can use any WL functions but you should add "Parent." before this function.
Unfortunately, you can't create new WL workspace from this thread ... (For Cone and Eugene: it was joke)
Size:
Color:
Eugene, Cone
I have the exact same problem with displaying forms. I need to use form.Show (form.ShowDialog blocks the originating wlp window and is not usable for me), but the form shows for an instant and then disappears. What is the best way to resolve this issue? How can I keep the form around?
-best, j
Size:
Color:
Eugene, Cone
Do you guys have any suggestions here? I do see a solution posted by mikhmv, but it is an old posting and I am not sure if it is the best way.
-thanks, J
Size:
Color:
Please count me out.
Size:
Color:
No problem, thank anyway :-)
Size:
Color: