I have a tab control with 3 Forms. Each form is designed also in Firefly and i attach it to the tabs of the tab control using this code:
'------------------------------------------------------------------------------------------------------------------------
Function SetTabChildWindow(ByVal hCtrl As Long, ByVal nTabIndex As Long, Hdlg As Long, Caption as String) As Dword
Local TCITEM As TC_ITEM
TCITEM.mask = %TCIF_PARAM
TabCtrl_GetItem Hctrl, nTabIndex, TCITEM
TCITEM.lparam = Hdlg
DLGS(nTabIndex) = Hdlg
TCITEM.mask = %TCIF_PARAM
SetParent Hdlg, HCtrl
Local RC As Rect
GetWindowRect Hctrl, RC
SetWindowPos Hdlg, 0, _
0, 24, _
(rc.nRight-RC.NLEFT)-4, (rc.nBottom-RC.NTOP)-25, _
%SWP_NOZORDER Or %SWP_NOREDRAW
ShowWindow Hdlg, %SW_HIDE
TabCtrl_SetItem Hctrl, nTabIndex, TCITEM
FF_TabControl_SetText (Hctrl, Caption, nTabIndex)
Function = %true
End Function
When i press a button in the dialog containing the tab control, it works. But when
i press a button in a form contained in the tab control, the app hangs, even if the
button procedure is empty.
Any ideas why is this happening?
Why aren't you using FireFly's built in method of assigning the child Forms to the Tab Control? Why are you trying to do it manually? It would be a lot easier to use the "Custom" property of the TabControl control and assign the child Forms to each tab. Am I missing something about your approach?
Is there a Firefly Approach? I dont know it. Where do i learn it?
Quote from: Elias Montoya on August 20, 2007, 09:47:34 PM
Is there a Firefly Approach? I dont know it. Where do i learn it?
There sure is. The "Custom" property of the TabControl control and assign the child Forms to each tab. It is very easy using this method. I have attached a screenshot of the "Custom" dialog that appears when that property is selected.
I saw that, but i thought it was only for naming and adding the tabs.
How do i specify a dialog for each tab? I tried everything but i cant attach
a dialog to a tab from there. Do i have to set a special flag in the dialogs
i want to use in the tabs?
The "Child Page Dialog" combobox doesnt display any options, and i cant type
anything there...
Ugh... Answer was It was on the help file. Thanx paul, works great. :)
Quote from: Elias Montoya on August 20, 2007, 11:39:22 PM
...Answer was It was on the help file.
No worries, I never read help files things either! :D