Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27365

Reference to caller form's public variable/function

$
0
0
There' a form(formA) which calls another form(formB).

formA calls formB like this.


Using frm As New formB
frm.ShowDialog(Me)
End Using

In formB, refer to formA's control like this.
CType(Me.Owner, formA).Text1.Text = "AAA"


How do I refer formA's public variable or public function?
Should I use CType(Me.Owner, formA) like control?
CType(Me.Owner, formA).myVar = 1
ret = CType(Me.Owner, formA).myFunc()
or just do like this?
formA.myVar = 1
ret = formA.myFunc()

Viewing all articles
Browse latest Browse all 27365

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>