Quantcast
Channel: Windows Forms General forum
Viewing all articles
Browse latest Browse all 12583

Why must I click twice (not double click) on a ToolStrip Save icon to activate it?

$
0
0

On my WinForm applications, I prefer using the ToolStrip's Save button to trigger the final edits on a dialog's screen before returning control to its caller.  On all of them, a single click works, except one which requires two clicks (not a double click), and i'd like your help to eliminate this two click requirement.

The significant difference between this dialog and the others is that there are two Save buttons and related labels in the ToolStrip where the others only have one of each.  Their respective names are: btn_TS_SaveArrive, lbl_TS_SaveArrive, btn_TS_SaveLeave, and lbl_TS_SaveLeave.  Only one set is Visible at a time, and this depends on the procedures being activated at an iteration.  I've attached a copy of the VB code for when the btn_TS_SaveLeave is clicked (two seperate clicks in the case).

    Private Sub btn_TS_SaveLeave_Click(ByVal sender As System.Object, _
                                       ByVal e As System.EventArgs) _
                                       Handles btn_TS_SaveLeave.Click
        If leaveTimeFaildEdits Then
            EditLeaveTimeData()
            Exit Sub
        End If

        If tagLeaveAmPm Is Nothing Then
            DisplayMissedAmPmMessage("Leave")
            Exit Sub
        End If

        btnDone.Enabled = True
    End Sub

    Private Sub btnDone_Click(ByVal sender As System.Object, _
                                ByVal e As System.EventArgs) _
                                Handles btnDone.Click
        If searchFor = "date" Then
            Me.Tag = dtpDate.Text.ToString
        Else
            If arriveTimeFailedEdits Or leaveTimeFaildEdits Then
                Exit Sub
            Else
                Me.Tag = (tagArriveTime & tagArriveAmPm & tagLeaveTime & _
                tagLeaveAmPm).ToString
            End If
        End If

        Me.DialogResult = System.Windows.Forms.DialogResult.OK
        Me.Close()
    End Sub
End Class
The following is the properties set for the btn_TS_SaveLeave button:

Terry 01


Viewing all articles
Browse latest Browse all 12583

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>