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 up/down button is pressed.
VB.NET | Private Sub object_UpDownPress(ByVal sender As Object, ByVal e As EventArgumentType) Handles object.UpDownPress |
VB | Private Sub object_UpDownPress(ByVal Up As Boolean, ByVal FieldStart As Long, ByVal FieldEnd As Long, ByVal Counter As Long, Field As String) |
C#.NET | void object_UpDownPress(object sender, EventArgumentType e); |
VC++ | void OnUpDownPressobject(VARIANT_BOOL Up, long FieldStart, long FieldEnd, long Counter, _bstr_t* Field); |
C | HRESULT OnUpDownPressobject(VARIANT_BOOL Up, long FieldStart, long FieldEnd, long Counter, BSTR* Field); |
object
Up
True if the upper button was pressed, usually indicating a value increment or False if the lower button was pressed.
FieldStart
The starting position of the numeric field.
FieldEnd
The length of the numeric field.
Counter
The current event counter. The event count starts at 0 when the up/down button is first pressed (or when the up/down arrow key is used). While the button (or key) remains pressed, the UpDownPress event occurs at regular intervals (every 0.1 seconds), each time the Counter value is incremented by 1. This can be used to delay additional increments or decrements by waiting until Counter reaches a certain value. It can also be used to accelerate or increase the increment used. The example below shows how this can be implemented.
Field
The contents of the numeric field as a string. The application returns a new string value in this argument. If the Field value is not modified by the application, the up/down button have no effect.
The UpDownPress event occurs when the up/down button is pressed.
The UpDownPress event only occurs for numeric fields without minimum/maximum range.
The UpDownHandled event occurs after the UpDownPress event, indicating that the control contents have been modified using the up/down button.
SftMaskSSN.Text = "444-12-1111" ' a social security number SftMaskToday.Contents.DateTime = Today ' set today's date SftMaskTime.Contents.DateTime = TimeOfDay SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent SftMaskAmount.Text = CStr(199) SftMaskIPAddr.Text = "209.61.201.49" End Sub Private Sub SftMaskAmount_UpDownPress(ByVal sender As Object, ByVal e As AxSftMaskLib70._ISftMaskEvents_UpDownPressEvent) Handles SftMaskAmount.UpDownPress Dim Amount As Double Dim Increment As Single If e.counter = 0 Or e.counter > 5 Then Amount = Val(e.field) Increment = 0.01 If e.counter > 14 Then Increment = 0.1 If e.counter > 23 Then Increment = 1
SftMaskSSN.Text = "444-12-1111" ' a social security number SftMaskToday.Contents.DateTime = Date ' set today's date SftMaskTime.Contents.DateTime = Time SftMaskPercent.Contents.Value(0) = 50 ' start with 50 percent SftMaskAmount.Text = 199 SftMaskIPAddr.Text = "209.61.201.49" End Sub Private Sub SftMaskAmount_UpDownPress(ByVal Up As Boolean, ByVal FieldStart As Long, ByVal FieldEnd As Long, ByVal Counter As Long, Field As String) Dim Increment As Single If Counter = 0 Or Counter > 5 Then If Val(Field) = 0 Then Field = 0 End If Increment = 0.01 If Counter > 14 Then Increment = 0.1
SftMaskIPAddr.Text = "209.61.201.49"; } private void Command1_Click(object sender, System.EventArgs e) { Application.Exit(); } private void SftMaskAmount_UpDownPress(object sender, AxSftMaskLib70._ISftMaskEvents_UpDownPressEvent e) { double amount; double increment; if (e.counter == 0 || e.counter > 5) { amount = Convert.ToDouble(e.field); increment = 0.01; if (e.counter > 14) increment = 0.1;
pFont->put_Bold(TRUE); ISftMaskCaptionPtr pCapt = m_vSftMaskIPAddr->GetCaption(); pFont = pCapt->GetFont(); pFont->put_Italic(TRUE); return TRUE; // return TRUE unless you set the focus to a control } void CSample1Dlg::OnUpDownPressSftMaskAmount(BOOL Up, long FieldStart, long FieldEnd, long Counter, BSTR FAR* Field) { double Incr; if (Counter == 0 || Counter > 5) { wchar_t* endchar; double Val = wcstod(*Field, &endchar);
See Also SftMask Events | Object Hierarchy