Hello shimonir and Al S,
A quick way to resolved the focus issue with the numeric control on the easy tab would be to add the numeric control to the panel before adding the panel to the easy tab.
For instance, using Al S's code, instead of:
EasyTab_AddPanels(hMainPanel, tabCtrl, 1, hNewPanel, 0);
EasyTab_LoadPanels (hMainPanel, tabCtrl2, 1, "NewCtrl.uir", __CVIUserHInst, PANEL_2, &hPanel2, 0);
newControlOnTab = NewCtrl (hNewPanel, CTRL_NUMERIC_LS, "Created at RunTime", 50, 50);
newControlOnMain = NewCtrl (hMainPanel, CTRL_NUMERIC_LS, "Created at RunTime", 220, 15);
. . .
Try:
newControlOnTab = NewCtrl (hNewPanel, CTRL_NUMERIC_LS, "Created at RunTime", 50, 50);
newControlOnMain = NewCtrl (hMainPanel, CTRL_NUMERIC_LS, "Created at RunTime", 220, 15);
...
EasyTab_AddPanels(hMainPanel, tabCtrl, 1, hNewPanel, 0);
EasyTab_LoadPanels (hMainPanel, tabCtrl2, 1, "NewCtrl.uir",__CVIUserHInst, PANEL_2, &hPanel2, 0);
This rearrangement of code seems to resolve the problem shimonir is seeing (if you aren't trying to add a numeric control to the main panel at run time). There is still an issue with the numeric control on the main panel getting focus back (and I am looking further into this).
Hope that helps, and I will post any other findings. Thanks.
Wendy L
LabWindows/CVI Developer Newsletter