SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
The drop down button is clicked.
VB.NET | Private Sub object_DropDownClick(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.DropDownClick |
VB | Private Sub object_DropDownClick() |
C#.NET | void object_DropDownClick(object sender, EventArgumentType e); |
VC++ | void OnDropDownClickobject(); |
C | HRESULT OnDropDownClickobject(); |
object
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.
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)
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
} 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();
} 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