I'm screwing around with VB and dialogs, but can't seem to get reading and writing TextBox controls to work. My code is below. It appears to me I *should* be able to write to the TextBox control with:
Dlg1.VFDFreq = "abcd" or, perhaps Dlg1.VFDFreq.Text = "abcd"
Both throw syntax errors. What am I doing wrong?
Regards,
Ray L.
' Spindle Speed Calculator
Sub Main
Begin Dialog BoxSample 16,35,256,89,"Motor Speed Calculator", .OnAction
CancelButton 204,44,40,14
Text 12,12,64,8,"Target Speed:"
TextBox 16,24,32,10, .TargetSpeed
Text 130,12, 50, 8,"VFDFreq:"
TextBox 130, 24, 50, 10, .VFDFreq
End Dialog
Dim Dlg1 As BoxSample
Button = Dialog ( Dlg1 )
End Sub
Function OnAction( ControlID$, Action%, SuppValue% )
Dlg1.VFDFreq.Text("ABCD")
Select Case Action%
Case 1
Case 2
If ControlID$ = "TargetSpeed" Then
Dlg1.VFDFreq.Text = "1234"
End If
Case Else
End Select
End Function