Private Sub cmdPad_Click()
Dim value As String
Dim pad_text As String
Dim length As Integer
value = txtString.Text
pad_text = txtPad.Text
length = CInt(txtLength.Text)
If optSide(0).value Then
' Pad on left.
txtResult.Text = Right$( _
String(length, pad_text) & value, length)
Else
' Pad on right.
txtResult.Text = Left$( _
value & String(length, pad_text), length)
End If
End Sub
|