Skip to Content
0
Former Member
Feb 26, 2007 at 10:35 PM

How to hide a control (Visible = False) ?

197 Views

Well,

I wrote this code to create controls dinamically on the Employee Master form, but the only thing that doesn't work is the Visible property of a couple of textboxes that are supposed to be hidden.

        With oNewTextItem
            .Left = mintLeft
            .Top = mintTop
            .Width = intWidth
            .Height = intHeight
            .TextStyle = intTextStyle
            .FromPane = intFromPane
            .ToPane = intToPane
            .Visible = blnVisible
            If Not blnVisible Then
                .SetAutoManagedAttribute(SAPbouiCOM.BoAutoManagedAttr.ama_Visible, SAPbouiCOM.BoAutoFormMode.afm_All, SAPbouiCOM.BoModeVisualBehavior.mvb_False)
            End If
            If Not oLabelItem Is Nothing Then
                oLabelItem.LinkTo = .UniqueID
            End If
            mobjTextBox = .Specific
        End With
        With mobjTextBox ' data bind
            If Len(Trim(strFieldName)) > 0 Then .DataBind.SetBound(True, strTableName, strFieldName)
        End With

Why it .Visible and/or SetAutoManagedAttribute doen't work ?