Is it possible to change the value of a string from a function, because I'm having a problem here?
The general idea would be like below, but the string will not change, so is there any way I make that happen?
EDIT: Fixed that by changing ByVal into ByRef, I'm such an idiot.
The general idea would be like below, but the string will not change, so is there any way I make that happen?
vb.net Code:
Public Class Form1 Dim MyItem1, MyItem2, MyItem3 As Integer Public Function SetItemStats(ByVal CurrentItemSlot As ComboBox, ByVal CurrentItemName As String) CurrentItemName = CurrentItemSlot.Text End Function Private Sub SetItem1Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SetItem1Button.Click SetItemStats(item1list, MyItem1) ' item1list is the name of my combobox. MsgBox(MyItem1) ' Comes out empty here End Sub End Class
EDIT: Fixed that by changing ByVal into ByRef, I'm such an idiot.