Click here to Skip to main content
15,886,422 members

Comments by ADemontis (Top 6 by date)

ADemontis 21-Jan-18 14:00pm View    
would not this run every 30 seconds?
ADemontis 30-Aug-14 10:36am View    
i have modified it this way but still does not work

Friend Sub newbutton_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)
If drag = False Then
Try
LeggiDizionario(sender, My.Application.Info.DirectoryPath & "\custom\custombuttons.txt")
Process.Start(My.Settings.buttprocess)
ignoreclick = False
Catch ex As Exception
MsgBox("Cannot start process - check definition")
End Try
dict.Clear()
End If
End Sub
ADemontis 29-Aug-14 13:21pm View    
what do you exatcly mean by 'check it in the click handler'?
I have modified the code:

Friend Sub newbutton_MouseClick(sender As Object, e As System.Windows.Forms.MouseEventArgs)

If ignoreclick = True And drag = False Then
' reads the file where the process definition i stored and associates the process to the button depending on the button name
Try
LeggiDizionario(sender, My.Application.Info.DirectoryPath & "\custom\custombuttons.txt")
Process.Start(My.Settings.buttprocess)
ignoreclick = False
Catch ex As Exception
MsgBox("Cannot start process - check definition")
End Try
dict.Clear()
Else
MsgBox(ignoreclick.ToString)
End If


End Sub
Private Sub newbutton_MouseDown(sender As Object, e As MouseEventArgs)
drag = True
ignoreclick = False
mousex = Windows.Forms.Cursor.Position.X - sender.Left
mousey = Windows.Forms.Cursor.Position.Y - sender.Top
End Sub
Private Sub newbutton_MouseUp(sender As Object, e As MouseEventArgs)
drag = False
ignoreclick = True
End Sub
Private Sub newbutton_MouseMove(sender As Object, e As MouseEventArgs)
If drag = True And ignoreclick = False Then
sender.Top = Windows.Forms.Cursor.Position.Y - mousey
sender.Left = Windows.Forms.Cursor.Position.X - mousex
End If
End Sub


the drag part works well but i don't know why i always get the ignoreclick to False status
ADemontis 29-Aug-14 9:41am View    
'to click the mouse' is pushing the button and releasing... a click is formally made up of a mousedown followed by a mouseup events. But te mpuseclick event seems to be unusable along with the 2 single parts that make a click (mousedown and mouseup). I am lloking for a workaround to use the 3 events on the same object.
ADemontis 29-Aug-14 9:39am View    
I don't want to simulate anything, i want to use mouse events and assign an action on every event.
But thhe 'mouseclick' event seems to be unusable along with mouseup and mousedown.