HeaderPane
Main
Hide
Share Link
Print

Click Event, SftButton Object

The button is clicked.

Syntax

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

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

C# View entire sample code

    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)
{

VB.NET View entire sample code

Private Sub button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button1.Click
    Application.Exit()
End Sub

Private WorldIndex As Integer = 0

Private Sub SetImage()
    ' Update the button with the next image in the image list
    ' to get the spinning globe effect
    AxSftButton4.Image1.NETImageObject = ImageList1.Images(WorldIndex)
    WorldIndex = WorldIndex + 1
    If WorldIndex >= ImageList1.Images.Count() Then WorldIndex = 0
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    ' Update the button bitmap every so often to get the

C++ View entire sample code

// 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

VB6 View entire sample code

    ' 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

See Also SftButton Object | Object Hierarchy


Last Updated 11/03/2026 - (email)
© 2026 Softel vdm, Inc.