Switching forms with tabs programmatically

Started by Mark Strickland, July 16, 2005, 03:25:14 AM

Previous topic - Next topic

Mark Strickland

I have tried just about everything to change and redisplay a form on a tab control from a button event.  I cannot get this to work.

I tried all of these in various combinations ---

   FORMRX_SHOW (HWND_FORMRX, %true)
 or
   FF_TABCONTROL_SETSELECTEDTAB (HWND_FORMMAIN_TABMAIN, 0)
 or
   FF_TABCONTROL_SETTABFOCUS (HWND_FORMMAIN_TABMAIN, 0)
 or
   FF_CONTROL_SHOWSTATE (HWND_FORMRX, %SW_RESTORE)

None of this seems to work.

I also get some strange behavior:

It seems the active tab changes (I can see it change to the selected tab) but the form does not change on the screen and it is still active (input TextBoxes still work).

If I click the mouse on the newly activated tab the form does not change.

If I click the mouse on a different tab then back on the one I changed to via the program it is still on the form on the tab where I started not the one where I clicked.

To select the tab that I tried to switch to via the program I have to mouse click the tab where I started then I can select the one where I tried to select via the program.

Mark

Jean-Pierre LEROY

Hi Mark,

I used to add these two lines of code to change and redisplay a form on a tab control by program :

FF_TabControl_SetTabFocus (Handle to the Tab Control, Tab Index value to select )
FF_TabControl_SetSelectedTab (Handle to the Tab Control, Tab Index value to select )


Jean-Pierre LEROY

Mark Strickland

Thanks Jean-Pierre

I cut and pased your two lines, set the handle and tab, and it worked.

I thought I had tried that obvious combo but it was 2am and this project has many forms and many multi-level tabs (tab controls on tab controls).  I probably had some handles mixed up.

Thanks Again!!!

TechSupport

Quote from: Mark Strickland... and many multi-level tabs (tab controls on tab controls).
:) I have never tried that before... I hope it works okay for you. Let me know if it doesn't.