cancel
Showing results for 
Search instead for 
Did you mean: 

check box problem ?

Former Member
0 Kudos

hi expert all

when my check box is true matrix, button are visible it will stay in the form . but when i check box is false matrix ,button also will stay.. please help me.

my code

draw form ()

oItem = oForm.Items.Add("chekItm", SAPbouiCOM.BoFormItemTypes.it_CHECK_BOX)
        oItem.Left = 565
        oItem.Width = 65
        oItem.Top = 182
        oItem.Height = 20
        oCheckBox = oItem.Specific
        oCheckBox.Caption = "delivery "
        oCheckBox.DataBind.SetBound(True, "@VTPR", "U_chkDo")

''''''''''''''''''''''''''''''''' item event

If (pVal.ItemUID = "chekItm") = True And (pVal.BeforeAction = False) Then

            'If Chk1.Checked = True Then

            oForm.Items.Item("BtnAdd").Visible = True
            oForm.Items.Item("tQTxt").Visible = True
            oForm.Items.Item("trval").Visible = True
            oForm.Items.Item("Mat1").Visible = True
            oForm.Items.Item("Btn2").Visible = True
            oForm.Items.Item("REgTxt").Visible = True
  End If

Accepted Solutions (1)

Accepted Solutions (1)

costas_ioannou2
Active Participant
0 Kudos

Hi, I'm not sure I understand the problem. Would you like the items to disappear when you uncheck the checkbox? If so then just add this to your code

'If Chk1.Checked = False Then

oForm.Items.Item("BtnAdd").Visible = False

oForm.Items.Item("tQTxt").Visible = False

oForm.Items.Item("trval").Visible = False

oForm.Items.Item("Mat1").Visible = False

oForm.Items.Item("Btn2").Visible = False

oForm.Items.Item("REgTxt").Visible = False

End If

I'm sorry if I didn't understand the question

Former Member
0 Kudos

yes ... its problem of disappear.

how to define chk1 ?

costas_ioannou2
Active Participant
0 Kudos

Hi,

Well in c# you can access the checkbox like this:

oItem = oForm.Items.Item("chekItm");

oCheckBox = (SAPbouiCOM.CheckBox)(oItem.Specific);

and then use this to see if it is checked

if( oCheckBox.Checked)

I hope this helps

Answers (0)