真实的国产乱ⅩXXX66竹夫人,五月香六月婷婷激情综合,亚洲日本VA一区二区三区,亚洲精品一区二区三区麻豆

成都創(chuàng)新互聯(lián)網(wǎng)站制作重慶分公司

vb.net返回兩個(gè)參數(shù) vbchoose函數(shù)返回值

VB中函數(shù)怎么返回兩個(gè)返回值

要返回多個(gè)值,有幾種辦法,最直接的就是用傳址參數(shù)

成都創(chuàng)新互聯(lián)公司專業(yè)為企業(yè)提供松北網(wǎng)站建設(shè)、松北做網(wǎng)站、松北網(wǎng)站設(shè)計(jì)、松北網(wǎng)站制作等企業(yè)網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計(jì)與制作、松北企業(yè)網(wǎng)站模板建站服務(wù),十多年松北做網(wǎng)站經(jīng)驗(yàn),不只是建網(wǎng)站,更提供有價(jià)值的思路和整體網(wǎng)絡(luò)服務(wù)。

Function f1(byref retVal1,byref retVal2)

或者用全局變量(比如模塊級變量)

或者返回包裝過的對象

或者返回多個(gè)返回值糅合的字符串

vb.net多線程如何返回參數(shù),舉個(gè)例子,謝謝

Public?Class?Form1

Public?Class?SquareClass?'把多線程調(diào)用的函數(shù)封裝到類中,通過類事件返回

Public?Value?As?Double

Public?Square?As?Double

Public?Event?ThreadComplete(ByVal?Square?As?Double)

Public?Sub?CalcSquare()

Square?=?Value?*?Value

RaiseEvent?ThreadComplete(Square)

End?Sub

End?Class

Dim?WithEvents?oSquare?As?SquareClass

Private?Sub?Button1_Click(sender?As?Object,?e?As?EventArgs)?Handles?Button1.Click?'多線程返回值測試,當(dāng)線程運(yùn)行完成激發(fā)事件

oSquare?=?New?SquareClass()

Dim?t?As?New?Threading.Thread(AddressOf?oSquare.CalcSquare)

oSquare.Value?=?30

t.Start()

End?Sub

Sub?SquareEventHandler(ByVal?Square?As?Double)?Handles?oSquare.ThreadComplete?'響應(yīng)事件函數(shù)

MsgBox("The?square?is?"??Square)

End?Sub

End?Class

vb,函數(shù),能不能返回兩個(gè)值.

不但可以返回兩個(gè)值,還可以更多。例如 4 個(gè)。

Private Sub Command1_Click()

Dim My1 As Boolean, a1 As Long, a2 As String, a3 As Long

My1 = MyFun(1,a1, a2, a3)

'顯示返回的 4 個(gè)變量的值

Me.Cls

Me.Print My1

Me.Print a1

Me.Print a2

Me.Print a3

End Sub

Private Function MyFun(S as long ,a1 As Long, a2 As String, a3 As Long) As Boolean

MyFun = True

a1 = 100

a2 = "MyStr"

a3 = "200"

End Function


本文題目:vb.net返回兩個(gè)參數(shù) vbchoose函數(shù)返回值
本文網(wǎng)址:http://weahome.cn/article/doihecd.html

其他資訊

在線咨詢

微信咨詢

電話咨詢

028-86922220(工作日)

18980820575(7×24)

提交需求

返回頂部