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
This sample illustrates drop down buttons and popup menus.
The source code is located at C:\Program Files (x86)\Softelvdm\SftButton OCX 3.0\Samples\VB6\Popup\Form1.frm or C:\Program Files\Softelvdm\SftButton OCX 3.0\Samples\VB6\Popup\Form1.frm (on 32-bit Windows versions).
Option Explicit
Dim LastPicture As Integer
Private Sub CloseButton_Click()
Unload Form2
End
End Sub
Private Sub Form_Unload(Cancel As Integer)
Unload Form2
End Sub
Private Sub PicTimer_Timer()
' Update the button bitmap every so often to get the
' 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
Dim x As Single, y As Single
With SftButton1
x = .Left + .Width
y = .Top + .Height
PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
End With
End Sub
Private Sub SftButton2_Click()
' Invoke the default action, because the button was clicked
Call Form2.popupMenu_DefaultAction_Click
End Sub
Private Sub SftButton2_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 SftButton2
x = .Left + .Width
y = .Top + .Height
.BorderAlways = True
PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
.BorderAlways = False
End With
End Sub
Private Sub SftButton3_Click()
' Invoke the default action, because the button was clicked
Call Form2.popupMenu_DefaultAction_Click
End Sub
Private Sub SftButton3_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 SftButton3
x = .Left + .Width
y = .Top + .Height
PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
End With
End Sub
Private Sub SftButton4_Click()
' Invoke the default action, because the button was clicked
Call Form2.popupMenu_DefaultAction_Click
End Sub
Private Sub SftButton4_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 SftButton4
x = .Left + .Width
y = .Top + .Height
PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
End With
End Sub
Private Sub SftButton5_Click()
' Invoke the default action, because the button was clicked
Call Form2.popupMenu_DefaultAction_Click
End Sub
Private Sub SftButton5_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 SftButton5
x = .Left + .Width
y = .Top + .Height
PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
End With
End Sub
