Question Displaying Class Objects

gsoalan

New member
Joined
Oct 17, 2009
Messages
3
Programming Experience
Beginner
Hello all. I am learning vb.net and right now I am struggling. I am trying to figure out how to print out my stock CLASS.

I have a timer click event that will create a new stock object with dummy information. Everytime I create a new object, I want to print it out, just to make sure everything is working correctly

VB.NET:
Public Class stock
    Private dblopen As Double
    Private dblclose As Double
    Private dblhigh As Double
    Private dbllow As Double

    Public Sub New()
        dblopen = 100
        dblclose = 200
        dblhigh = 300
        dbllow = 1
    End Sub

    Public Sub displayStock()
        WriteLine("Open {0}, dblopen")

    End Sub
End Class

Here is the code that actually controls the program

VB.NET:
Public Class Form1
    Dim array_list As New ArrayList
    Dim sp500 As New stock

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim x As Integer
        ListBox1.Items.Add(100)

        'For x = 1 To 100
        '    ListBox1.Items.Add(x)

        'Next
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        'array_list.Add(100)
        'ListBox1.Items.Add(sp500)
        sp500.displayStock()
    End Sub
End Class

Thanks
 
What do you mean "print it out"? Where exactly do you want it displayed? You can call Debug.WriteLine to write to the Output window in the debugger without interfering with a Release build.
 
Back
Top