頭等艙;
Public Class Settings
Dim goal_x As Integer
Private Sub button_Click(sender As Object, e As EventArgs) Handles button.Click
goal_x = Convert.ToInt32(goal_x_set.Text)
End Sub
End Class
我要訪問此goal_x整型變量在不同的類,換句話說,我希望變量值來計算不同類的東西slimier這個
在第二類中的百分比
Public Class shift_1
Private Sub button11_Click(sender As Object, e As EventArgs) Handles button11.Click
shft1_gage.Value = (Parameter Value from Class 1{goal_1})*5645/38745*100
End Sub
請閱讀[問]並參加[導遊]。研究*屬性*如果你想讓你的班級向其他演員展示某些東西。這是OOP – Plutonix
的一個非常基本的概念,請閱讀_Access Levels_和_Access修飾符_:https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/declared-elements/訪問級別 –
只是將'公共goal_x作爲Integer'並將其用作'Settings.goal_x'在另一個你想要的地方 – Subaz