AppendText is not a member System.Windows.Forms.Buttons

Private Sub txtreciptappend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtrecipt.Click

    txtrecipt.Text = ""
    txtrecipt.appendtext("" + vbNewLine)
    txtrecipt.Appendtext("===========================Online Activation Pay Slip=========================" + vbNewLine)
    txtrecipt.Appendtext("==============================================================================" + vbNewLine)
    txtrecipt.Appendtext("" + vbNewLine)

    txtrecipt.Appendtext("" + vbNewLine)
    txtrecipt.Appendtext("Employee Name: " + vbTab & NameTextBox.Text + vbTab + vbTab + vbTab & EmployerTextBox.Text + vbNewLine)
    txtrecipt.Appendtext("Address: " + vbTab & AddressTextBox.Text + vbNewLine)
    txtrecipt.Appendtext("ID: " + vbTab & IDTextBox.Text + vbNewLine)
    txtrecipt.Appendtext(vbTab + vbTab + vbTab + vbTab + vbTab + vbTab & "PRIVATE & CONFIDENTIAL" + vbNewLine)
    txtrecipt.Appendtext(" " & vbNewLine)
    txtrecipt.Appendtext("Employer Name: " + vbTab & EmployerTextBox.Text + vbTab + vbTab + vbTab & "PayDate" + vbTab + vbTab & Pay_DateDateTimePicker.Text + vbNewLine)
    txtrecipt.Appendtext("Employee Name: " + vbTab & NameTextBox1.Text)

    txtrecipt.Appendtext("==============================================================================" + vbNewLine)

    txtrecipt.Appendtext(" " & vbNewLine)
    txtrecipt.Appendtext("Basic Salary: " + vbTab & Basic_SalaryTextBox.Text + vbTab & "Absent: " + vbTab & AbsentTextBox.Text + vbTab & "Late: " + LateTextBox.Text + vbTab & "Short Leave: " + Short_LeaveTextBox.Text + vbTab & "Half Day: " + Half_DayTextBox.Text + vbNewLine)
    txtrecipt.Appendtext(" " + vbNewLine + vbNewLine)
    txtrecipt.Appendtext("Payment: " + vbTab + vbTab & PaymentTextBox.Text + vbTab & "Deductions: " + vbTab & DeductionTextBox.Text + vbTab & "Net Pay: " + vbTab & netpay.Text + vbNewLine)

    txtrecipt.Appendtext("==============================================================================" + vbNewLine)

    txtrecipt.Appendtext(" " + vbNewLine + vbNewLine)
    txtrecipt.Appendtext(Today & vbTab + vbTab + vbTab + vbTab + vbTab + vbTab + vbTab + vbTab & TimeOfDay + vbNewLine)
    txtrecipt.Appendtext("==============================================================================" + vbNewLine)
    txtrecipt.Appendtext("                         WITH THANK'S FROM INTERSCAN                          " + vbNewLine)
    txtrecipt.Appendtext("==============================================================================" + vbNewLine)

I'm receiving error in txtrecipt.Appendtext.

1 answer

  • answered 2018-11-08 07:20 Nakul

    In your code txtrecipt.appendtext is wrong

    make txtrecipt as StringBuilder

    example:

    StringBuilder txtrecipt = new StringBuilder ();
    

    Then change appendtext to AppendLine("your string")