按钮2的文本显示在按钮1的文本框中 - VS Express 2013 -

时间:2017-03-20 21:59:02

标签: vb.net webforms

不确定如何解决或我做错了什么?请帮帮....

Partial Class _Default
Inherits System.Web.UI.Page

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles ariesText.Click
    Me.displayText.Text += "Aries'The Ram' March 21 - April 19 Aries people are creative, adaptive, and insightful.  They can also be strong-willed and spontaneous (sometimes to a fault)."

End Sub

Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles taurusText.Click
    Me.displayText.Text += "Taurus 'The Bull' April 20 - May 20 Taurus zodiac signs and meanings, like the animal that represents them, is all about strength, stamina and will. Stubborn by nature, the Taurus will stand his/her ground to the bitter end (sometimes even irrationally so)."

End Sub
End Class

1 个答案:

答案 0 :(得分:0)

我认为你应该删除+签名(它会附加文字,在你的情况下你必须覆盖它)

Partial Class _Default
    Inherits System.Web.UI.Page

    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles ariesText.Click

        Me.displayText.Text = "Aries'The Ram' March 21 - April 19 Aries people are creative, adaptive, and insightful.  They can also be strong-willed and spontaneous (sometimes to a fault)."

    End Sub

    Protected Sub Button2_Click(sender As Object, e As EventArgs) Handles taurusText.Click

        Me.displayText.Text = "Taurus 'The Bull' April 20 - May 20 Taurus zodiac signs and meanings, like the animal that represents them, is all about strength, stamina and will. Stubborn by nature, the Taurus will stand his/her ground to the bitter end (sometimes even irrationally so)."

    End Sub

End Class