Hide

SftButton/OCX 3.0 - Button Control

Display
Print

DropDownClick Event, SftButton Object

The drop down button is clicked.

Syntax

VB.NETPrivate Sub object_DropDownClick(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.DropDownClick
VBPrivate Sub object_DropDownClick()
C#.NETvoid object_DropDownClick(object sender, EventArgumentType e);
VC++void OnDropDownClickobject();
CHRESULT OnDropDownClickobject();

object

A SftButton object.

Comments

The DropDownClick event occurs when the drop down button is clicked or when the user presses Alt+Down Arrow. Depending on the DropDownDownClick property, the event occurs as the mouse button is pressed or released. Using properties such as the DropDownPressed property does not cause this event to occur.

If the user double-clicks the drop down button, the DropDownDblClick event also occurs.

The Click event occurs when the button is clicked.

Examples

VB.NET

    menuItem1_Click(AxSftButton1, New System.EventArgs)
End Sub

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

Private Sub AxSftButton1_DropDownClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles AxSftButton1.DropDownClick
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim pt As Point = New Point(AxSftButton1.Location.X + AxSftButton1.Size.Width, _
                            AxSftButton1.Location.Y + AxSftButton1.Size.Height)
    pt = PointToScreen(pt)
    AxSftButton1.CancelMode()
    TrackPopupMenu(ContextMenu1.Handle, Convert.ToUInt32(TPM_RIGHTALIGN Or TPM_TOPALIGN Or TPM_LEFTBUTTON), pt.X, pt.Y, 0, Me.Handle, IntPtr.Zero)

VB6

    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
    Dim x As Single, y As Single
    With SftButton1
        x = .Left + .Width
        y = .Top + .Height
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction

C#

}

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)
{
    // The drop down button was clicked. Display a popup menu
    // right-aligned with the right edge of the button
    Point pt = new Point(axSftButton1.Location.X + axSftButton1.Size.Width,
                            axSftButton1.Location.Y + axSftButton1.Size.Height);
    pt = PointToScreen(pt);
    axSftButton1.CancelMode();

C++

}

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
    // right-aligned with the right edge of the button
    RECT rect;
    m_Button1.GetWindowRect(&rect);     // get button position
    m_Button1.SendMessage(WM_CANCELMODE);// required before invoking popup menu
    ShowMenu(rect.right, rect.bottom);  // display the menu

See Also SftButton Object | Object Hierarchy


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