Results 1 to 3 of 3

Thread: Unwanted events

  1. #1

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Unwanted events

    Can anyone help me with this? Run this proyect, click the Open button and move the second form so that the label is placed above the first's form's treeview. Double-Click on the label.... Why does the event on the TreeView is triggered?
    Attached Files Attached Files
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Unwanted events

    Hola Compatriota!

    Its triggered cause its receiving the second click of the label double click,
    and it computes it as click.

    You could correct this simply adding a Public Boolean variable to Form1
    VB Code:
    1. Public mProcessClick As Boolean
    and..
    VB Code:
    1. Private Sub Form_Load()
    2.     mProcessClick = True
    3.     '...
    4. End sub
    5.  
    6. Private Sub TV1_NodeClick(ByVal Node As MSComctlLib.Node)
    7.     If mProcessClick Then
    8.         DebugPrint TV1.SelectedItem.Key & " - NodeClick"
    9.     End If
    10. End Sub
    Form2:
    VB Code:
    1. Private Sub Label1_DblClick()
    2.     Form1.mProcessClick = False
    3.     Unload Me
    4. End Sub

  3. #3

    Thread Starter
    Need-a-life Member Mc Brain's Avatar
    Join Date
    Apr 2000
    Location
    Buenos Aires, Argentina
    Posts
    6,808

    Re: Unwanted events

    It's not a solution. I need the event not to be trigger at all. This is because even I can override the event, the selected item might have been changed... and this is not a desired behaviour.
    Emiliano F. Martín


    If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
    Encourage the person who helped you to keep doing it, and give him the points he deserves.


    MP3 Organizer: Freeware to logically organize all your MP3s.

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