Hide

SftButton/OCX 3.0 - Button Control

Display
Print

Click Event, SftButton Object

The button is clicked.

Syntax

VB.NETPrivate Sub object_ClickEvent(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.ClickEvent
VBPrivate Sub object_Click()
C#.NETvoid object_ClickEvent(object sender, EventArgumentType e);
VC++void OnClickobject();
CHRESULT OnClickobject();

object

A SftButton object.

Comments

The Click event occurs when the button is clicked, when the user presses the space bar while the control has the input focus or the user presses the appropriate accelerator key (Alt+key). This event may also occur if the button is defined as the default button and the user presses the ENTER key. Using properties such as the Pressed property does not cause this event to occur.

The ClickStyle property defines how the control responds to mouse clicks.

The Click event is generated when the user releases the mouse button after clicking on the button using the left mouse button. If the user does not release the mouse button immediately, the ClickInterval property defines the interval between auto-repeat Click events.

If the user double-clicks the button, the DblClick event also occurs.

The DropDownClick event occurs when the drop down button is clicked.

Examples

VB.NET

Public ReadOnly TPM_LEFTBUTTON As Integer = 0

<DllImport("user32.dll")> _
Public Shared Function TrackPopupMenu(ByVal Handle As IntPtr, _
    ByVal uFlags As UInt32, ByVal x As Integer, ByVal y As Integer, _
    ByVal nReserved As Integer, ByVal hwnd As IntPtr, ByVal prcRect As IntPtr) As IntPtr
End Function

Private Sub AxSftButton1_ClickEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton1.ClickEvent
    ' Invoke the default action, because the button was clicked
    menuItem1_Click(AxSftButton1, New System.EventArgs)
End Sub

Private Sub AxSftButton2_ClickEvent(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton2.ClickEvent
    ' Invoke the default action, because the button was clicked
    menuItem1_Click(AxSftButton1, New System.EventArgs)

VB6

    ' spinning globe effect
    With SftButton4
        Set .Image1.Picture = WImage(LastPicture).Picture
        LastPicture = LastPicture + 1
        If LastPicture >= 16 Then LastPicture = 0
    End With
End Sub

Private Sub SftButton1_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton1_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button

C#

    MessageBox.Show("Action 2 selected");
}

private void menuItem4_Click(object sender, System.EventArgs e)
{
    MessageBox.Show("Action 3 selected");
}

private void axSftButton1_ClickEvent(object sender, System.EventArgs e)
{
    // Invoke the default action, because the button was clicked
    menuItem1_Click(axSftButton1, new System.EventArgs());
}

private void axSftButton1_DropDownClick(object sender, System.EventArgs e)
{

C++

// The system calls this to obtain the cursor to display while the user drags
//  the minimized window.
HCURSOR CPopupDlg::OnQueryDragIcon()
{
    return (HCURSOR) m_hIcon;
}

void CPopupDlg::OnClickSftbtn1()
{
    // Invoke the default action, because the button was clicked
    SendMessage(WM_COMMAND, IDM_DEFAULTACTION);
}

void CPopupDlg::OnDropDownClickSftbtn1()
{
    // The drop down button was clicked. Display a popup menu

See Also SftButton Object | Object Hierarchy


Last Updated 08/13/2020 - (email)
© 2024 Softel vdm, Inc.