Hello, I'm creating a program that will allow the user to enter payment information on the form and it will save that information to a sequential file. I'm getting an error that says 'padleft is not a member of char' on the line that I have *** in front of below. Can someone help me fix this error? I don't know what that error means. Thanks!!
[CODE=vbnet]Public Class Form1
Private Const paymentfile As String = "C:\checkfile.t xt"
Private _checknumber As String
Private _checkdate As Date
Private _payee As String
Private _checkamount As Decimal
Public Property checknumber() As String
Get
Return _checknumber
End Get
Set(ByVal value As String)
_checknumber = value
End Set
End Property
Public Property checkdate() As Date
Get
Return _checkdate
End Get
Set(ByVal value As Date)
_checkdate = value
End Set
End Property
Public Property payee() As String
Get
Return _payee
End Get
Set(ByVal value As String)
_payee = value
End Set
End Property
Public Property checkamount() As Decimal
Get
Return _checkamount
End Get
Set(ByVal value As Decimal)
_checkamount = value
End Set
End Property
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Me.Close()
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button2.Click
Dim path As String = "C:\documen ts and settings\tammy and rich\my documents\visua l studio 2005\projects\f ranklin calendars\"
Dim ourcheck As New Object
Dim payment As Object
Dim newlineindex As Integer
Dim recordindex As Integer
If checknumbertext box.Text <> String.Empty AndAlso checkdatetextbo x.Text <> String.Empty AndAlso payeetextbox.Te xt <> String.Empty AndAlso checkamounttext box.Text <> String.Empty Then
ourcheck.checkn umber = checknumbertext box.Text
newlineindex = Text.IndexOf(Co ntrolChars.NewL ine, recordindex)
****** My.Computer.Fil eSystem.WriteAl lText(path & "paymentfile.tx t", ourcheck.checkn umber.PadRight( 20) & ourcheck.checkd ate.ToString.Pa dLeft(10) & ourcheck.payee. ToString.PadLef t(10) & ourcheck.checka mount.ToString( "N2").PadLeft(1 0), True)
checknumbertext box.Text = String.Empty
checkdatetextbo x.Text = String.Empty
payeetextbox.Te xt = String.Empty
checkamounttext box.Text = String.Empty
End If
checknumbertext box.Focus()
End Sub
End Class[/CODE]
[CODE=vbnet]Public Class Form1
Private Const paymentfile As String = "C:\checkfile.t xt"
Private _checknumber As String
Private _checkdate As Date
Private _payee As String
Private _checkamount As Decimal
Public Property checknumber() As String
Get
Return _checknumber
End Get
Set(ByVal value As String)
_checknumber = value
End Set
End Property
Public Property checkdate() As Date
Get
Return _checkdate
End Get
Set(ByVal value As Date)
_checkdate = value
End Set
End Property
Public Property payee() As String
Get
Return _payee
End Get
Set(ByVal value As String)
_payee = value
End Set
End Property
Public Property checkamount() As Decimal
Get
Return _checkamount
End Get
Set(ByVal value As Decimal)
_checkamount = value
End Set
End Property
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Me.Close()
End Sub
Private Sub Button2_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button2.Click
Dim path As String = "C:\documen ts and settings\tammy and rich\my documents\visua l studio 2005\projects\f ranklin calendars\"
Dim ourcheck As New Object
Dim payment As Object
Dim newlineindex As Integer
Dim recordindex As Integer
If checknumbertext box.Text <> String.Empty AndAlso checkdatetextbo x.Text <> String.Empty AndAlso payeetextbox.Te xt <> String.Empty AndAlso checkamounttext box.Text <> String.Empty Then
ourcheck.checkn umber = checknumbertext box.Text
newlineindex = Text.IndexOf(Co ntrolChars.NewL ine, recordindex)
****** My.Computer.Fil eSystem.WriteAl lText(path & "paymentfile.tx t", ourcheck.checkn umber.PadRight( 20) & ourcheck.checkd ate.ToString.Pa dLeft(10) & ourcheck.payee. ToString.PadLef t(10) & ourcheck.checka mount.ToString( "N2").PadLeft(1 0), True)
checknumbertext box.Text = String.Empty
checkdatetextbo x.Text = String.Empty
payeetextbox.Te xt = String.Empty
checkamounttext box.Text = String.Empty
End If
checknumbertext box.Focus()
End Sub
End Class[/CODE]
Comment