Results 1 to 4 of 4

Thread: [RESOLVED] Double click on one MSHFLexgrid clicks on another MSHFlexGrid on another form

  1. #1

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Resolved [RESOLVED] Double click on one MSHFLexgrid clicks on another MSHFlexGrid on another form

    Hi.
    I've got a form with a MSHFlexgrid object and a button that will popup another form with another mshflexgrid.
    In the main form, clicking on a row it will provide details of that record on some textbox. Then I've got a button that will popup another form, so the user can choose a article. He chooses the article by double click and the popup form will unload.

    What happens is:
    when the user double clicks on the popup mshflexgrid, the parent mshflexgrid clicks to.
    How can I resolve this behavior?

    Thanks

  2. #2
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: Double click on one MSHFLexgrid clicks on another MSHFlexGrid on another form

    You evidently have code in the popup grid's DblClick() event that calls the parent grid's Click() event. Set a breakpoint at the top of the popup grid's DblClick() event and trace the code (using F8) to find what's causing the parent grid's Click() event code to run.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  3. #3
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Double click on one MSHFLexgrid clicks on another MSHFlexGrid on another form

    I remember this bug. The work around is to cause a delay before unloading the Form or use a timer to unload the form.

    Code:
    Private Sub MSHFlexGrid1_DblClick()
        Dim sngTimer As Single
        sngTimer = Timer + 0.2
        Do Until Timer > sngTimer
            DoEvents
        Loop
        Unload Me
    End Sub

  4. #4

    Thread Starter
    Hyperactive Member RS_Arm's Avatar
    Join Date
    Mar 2007
    Location
    Planet Earth
    Posts
    282

    Re: Double click on one MSHFLexgrid clicks on another MSHFlexGrid on another form

    Thanks Brucevde. That resolved my problem.
    Please, clarify me in one thing: what this piece of code do in processing? If I run this code in a slow computer, the user may wait more then the expected?

    Thank you again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width