PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Container controls?  (Read 218 times)

Philipp E. Weidmann

  • Guest
Container controls?
« on: May 05, 2005, 07:26:29 AM »

Hi!

Is there any way in FF right now to create controls that contain other controls, such as the picture box in VB which becomes the parent of the controls inside of it? This is important for creating wizards, since you have to show and hide a number of controls at once (the wizard's pages) and with a container control all you need do is show or hide the containers and everything inside will be hidden as well. Is there a way of doing it in FF without showing/hiding all controls seperately?

Thank you,

Philipp E. Weidmann
Logged

TechSupport

  • Guest
Container controls?
« Reply #1 on: May 05, 2005, 08:33:15 AM »

FireFly does not use the container metaphor like VB does. You can iterate all child controls of a form and hide them or show them by using the EnumChildWindows API.

I got this from the PB Forum (modified to show/hide controls):

EnumChildWindows() will enumerate all child windows on a window that are immediate children or descendants of the specified window. Therefore, if you know the identifier of the control and the handle of the top-level window, you can do the following:

Code: [Select]

'pass 0 to hide controls
EnumChildWindows hWndForm, CODEPTR(ChildEnumProc), 0

'or, pass 1 to show controls
EnumChildWindows hWndForm, CODEPTR(ChildEnumProc), 1

FUNCTION ChildEnumProc _
  ( _
  BYVAL hWnd    AS DWORD, _ ' handle of child window
  BYVAL lParam  AS LONG _   ' application-defined value
  ) AS LONG
             
  IF lParam = 0 THEN  
    ' Hide the control
    FF_Control_ShowState hWnd, %SW_HIDE
  ELSE  
    ' Show the control
    FF_Control_ShowState hWnd, %SW_SHOW
  END IF
             
    ' Keep looking
    FUNCTION = %TRUE
END FUNCTION  


I hope this helps!
Logged