|
Vilcabamba, Ecuador
Experience: Intermediate
Platform: Ninja
Trading: NQ, UB
Posts: 204 since Jul 2012
|
OK, taken from the indicator you mentioned, the code that will do this is:
using System.Runtime.InteropServices;
------------------------------------------------------------------------------------------------------------
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int wMsg, IntPtr wParam, IntPtr lParam);
--------------------------------------------------------------------------------------------------------------
CBAccount = ChartControl.Controls["pnlChartTrader"].Controls["ctrChartTraderControl"].Controls["cboAccount"] as System.Windows.Forms.ComboBox;
// to select the prior account in the list
SendMessage(CBAccount.Handle, 0x0100, (IntPtr)0x26, (IntPtr)0X1500001); //uparrow keydown
// to select the next account in the list
SendMessage(CBAccount.Handle, 0x0100, (IntPtr)0X28, (IntPtr)0X1500001); //downarrow keydown
--------------------------------------------------------------------------------------------------------------
works OK for me because I only have SIM and my production account in the ChartTrader account list when Live...if there are more than two accounts it would create need for more code
------------------------------------------------------------------------------------------------------------------------
THANK YOU vvhg and steve2222 !!
|