none
我所打的vb碼出現了錯誤,大家可不可以幫我看看那裡出現了問題,謝謝 RRS feed

  • 一般討論

  • Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)  handles Label3_Click. 

    End SubMsgBox("dONE!!")
        Me.CLOSE()

    End Sub

    Private Sub 

    Sub TXTResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private functioN

    Function DIVISION_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

         Function DIVISION(BYVAL(Number1 as double),byval(Number2 as double)end

    End Function

    Private Function


    Function DIVISION(ByVal PARA1 As Double, ByVal PARA2 As Double)

        txtresult.text = para1 - para2

    End Function

    Private FUNCTIOn

     Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        FUNCTION MULTIPLE(BYVAL(Number1 AS double),byval(Number2 AS DOUBLE) 

    End Function

    private sub



    Sub subtrad_(ByRef PARA1 As Double, ByRef PARA2 As Double) ')'

        txtResult.text = para1 + Para2


    End Sub

    Public Class Form1

        Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click


            MsgBox("Goodbye!!")

            Me.Close()


        End Sub


        Private Sub TxtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtName.TextChanged

        End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub

    End Class

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Text = "please enter your name:"
        InputBox("please enter your name:")

    End Sub

    PRIVATE SUB

    Sub ADD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TXTADD.Click
            ADD_(byvaL(Number1 as double),byval(Number2 AS double) end


    End Sub


    PRIVATE SUB

    Sub ADD_(ByVal PARA1 As Double, ByVal PARA2 As Double)

        TxtResult.Text = PARA1 + PARA2

    End Sub

    2012年11月16日 上午 03:39

所有回覆

  • 您好,

    可以說明錯誤的地方及訊息嗎? 謝謝.

    不過,您的Code是不是有折行呀!


    以上說明若有錯誤請指教,謝謝。
    亂馬客blog: http://www.dotblogs.com.tw/rainmaker/


    • 已編輯 亂馬客 2012年11月16日 上午 04:00
    2012年11月16日 上午 03:56
  • Private Sub Label3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)  handles Label3_Click. 

    End SubMsgBox("dONE!!")
        Me.CLOSE()

    End Sub

    Private Sub 

    Sub TXTResult_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

    End Sub

    Private function

    Function DIVISION_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

         Function DIVISION(BYVAL(Number1 as double),byval(Number2 as double)end

    End Function

    Private Function


    Function DIVISION(ByVal PARA1 As Double, ByVal PARA2 As Double)

        txtresult.text = para1 - para2

    End Function

    Private FUNCTION

     Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

        FUNCTION MULTIPLE(BYVAL(Number1 AS double),byval(Number2 AS DOUBLE) 

    End Function

    private sub



    Sub subtrad_(ByRef PARA1 As Double, ByRef PARA2 As Double) ')'

        txtResult.text = para1 + Para2


    End Sub

    Public Class Form1

        Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click


            MsgBox("Goodbye!!")

            Me.Close()


        End Sub


        Private Sub TxtName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TxtName.TextChanged

        End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        End Sub

    End Class

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Text = "please enter your name:"
        InputBox("please enter your name:")

    End Sub

    PRIVATE SUB

    Sub ADD_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TXTADD.Click
            ADD_(byvaL(Number1 as double),byval(Number2 AS double) end


    End Sub

    PRIVATE SUB

    Sub ADD_(ByVal PARA1 As Double, ByVal PARA2 As Double)

        TxtResult.Text = PARA1 + PARA2

    End Sub

    有底線的地方,表示在vb碼中出現籃色的曲線.

    2012年11月16日 上午 04:09
  • 您好,

    請問您的專案是從vb6升級上來的嗎?

    看起來是因為語法錯誤。

    您可參考VB.NET,調整一下程式,

    PRIVATE  Sub ADD_(ByVal PARA1 As Double, ByVal PARA2 As Double)

        TxtResult.Text = PARA1 + PARA2

    End Sub


    以上說明若有錯誤請指教,謝謝。
    亂馬客blog: http://www.dotblogs.com.tw/rainmaker/

    2012年11月16日 上午 04:40
  • 你的函式應該都要在 Class ....End Class 區間, 你把它放到 Class 外就錯了.

    在現實生活中,你和誰在一起的確很重要,甚至能改變你的成長軌跡,決定你的人生成敗。 和什麼樣的人在一起,就會有什麼樣的人生。 和勤奮的人在一起,你不會懶惰; 和積極的人在一起,你不會消沈; 與智者同行,你會不同凡響; 與高人為伍,你能登上巔峰。

    2012年11月16日 上午 05:19
    版主
  • 該不會是作業吧... 今天的回家作業是把錯誤的程式碼找出來...

    論壇是網友平等互助 保證解答請至 微軟技術支援服務


    提問時,錯誤情境描述與錯誤訊息很重要,情境描述包含你做了什麼,預期的結果與實際發生的結果。一個最爛的問法範例:「我的電腦電腦怎麼不能開機?」誰知道你家是不是沒電還是你根本找不到電源鈕。

    2012年11月16日 下午 01:14