AppendText不是System.Windows.Forms.Buttons的成员

时间:2018-11-08 07:15:37

标签: vb.net

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)

我在txtrecipt.Appendtext中收到错误消息。

1 个答案:

答案 0 :(得分:2)

您的代码txtrecipt.appendtext中的错误

将txtrecipt设置为StringBuilder

示例:

StringBuilder txtrecipt = new StringBuilder ();

然后将appendtext更改为AppendLine("your string")