[Gambas-user] Object.Class with forms
Daniel Campos
dcamposf at ...626...
Wed Nov 2 15:05:30 CET 2005
IF Object.Is ( pControl, "Form")=TRUE THEN
...
Should work
Regards,
D. Campos
2005/11/2, Dani Santos <jose.santos at ...429...>:
> Hi again!
>
> I've got to test wether a control is or not a form.
>
> I've made it work perfectly with TextBoxes, Labels, etc. with code like
> this:
>
> SELECT CASE Object.Class(pControl)
>
> CASE "Label"
> labelTmp = pControl
> labelTmp.BackColor = COLOR_TITULOS
> labelTmp.ForeColor = COLOR_TEXTOTITULOS
> CASE "Button"
> buttonTmp = pControl
> (...)
>
> But If I try to do it with forms, i.e. something like:
>
> ' Getting the parent form and attaching to the object for resizing
> ' purposes.
> m_intParentWidth = m_table.Parent.Width
> parentForm = m_table.Parent
> DO WHILE parentForm <> NULL
>
> IF Object.Class(parentForm) = "Form" THEN
> Object.Attach(parentForm, ME, "ParentForm")
> BREAK
> ELSE
> parentForm = parentForm.Parent
> ENDIF
> LOOP
>
> ObjectClass does not return "Form" for a Form object but "FrmMain",
> "FrmSelectTheme", etc. i.e., the name of the form.
>
> ¿Any idea about how knowing if a given control is a Form?
>
> Thanks.
>
> --
> Dani Santos <jose.santos at ...429...>
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server. Download
> it for free - -and be entered to win a 42" plasma tv or your very own
> Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
More information about the User
mailing list