Skip to Content
author's profile photo Former Member
Former Member

TimeDelayed in Selecting CheckBox

Hi To All

I am Having 5 CheckBoxes in my screen..In that last checkbox is SelectAll Checkbox..If i select that check box, all the other 4 checkboxes should be checked..Its working fine..But, when i click the SelectAll checkbox after 4 to 5 Seconds only all the other checkboxes are selected..I had given form freeze...Wats the problem...Here is my source code..

 Try
 Conv_Form.Freeze(True)
 Select Case pVal.EventType
 Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
 If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False Then
     If ChkSelectAll.Checked = "True" Then
        Chk1.Checked = "True"
        Chk2.Checked = "True"
        Chk3.Checked = "True"
        Chk4.Checked = "True"
      Else
        Chk1.Checked = "False"
        Chk2.Checked = "False"
        Chk3.Checked = "False"
        Chk4.Checked = "False"
      End If
  End If
 End Select
 Conv_Form.Freeze(False)
 Catch ex As Exception
 Conv_Form.Freeze(False)
 End Try

End Sub

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 05:01 AM

    Sridhar,

    I think, that after Chk1.Checked = "True" is called other event for checking checkbox and this is doing something. Try to do it as

    1. declare global variable calculate as boolean and set there default value True

    dim calculate as boolean
    calculate = True

    2. change the code as

    Try
     Conv_Form.Freeze(True)
     Select Case pVal.EventType
     Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
     If pVal.ItemUID = "chkSelectAll" And pVal.BeforeAction = False Then
         calculate = False
         If ChkSelectAll.Checked = "True" Then
            Chk1.Checked = "True"
            Chk2.Checked = "True"
            Chk3.Checked = "True"
            Chk4.Checked = "True"
          Else
            Chk1.Checked = "False"
            Chk2.Checked = "False"
            Chk3.Checked = "False"
            Chk4.Checked = "False"
          End If
      End If
     End Select
     caclulate = True
     Conv_Form.Freeze(False)
     Catch ex As Exception
     Conv_Form.Freeze(False)
     End Try

    3. in itemevent add condition, that everyting in itemevent will be executed only when calculate = True

    if caclulate = True then
    .. your itemevent
    
    end if

    In the past I fought with simillar problem and with variable for testing in itemevent it was solved. Its just idea and maybe it will not works for you, but you may try it.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.