Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB
Public Class Form2

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Public Sub qc_OnQuote(ByVal sender As Object, ByVal args As QuoteEventArgs)

        Dim str As String = args.ToString
        Dim bidask As String() = str.Split(" ")
        MsgBox(bidask(1) & " / " & bidask(2))
        Label8.Text = "" & bidask(1) & " / " & bidask(2)
    End Sub

    Private Sub ComboBox1_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.TextChanged
        Try
            Dim syms As String = ComboBox1.Text
            Dim sym As String() = syms.Split(",")
            Dim qc As QuoteClient = New QuoteClient(******, "*******", "**.***.***.***", ****)
            AddHandler qc.OnQuote, AddressOf Me.qc_OnQuote
            qc.Connect()
            qc.Subscribe(sym(0))
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub


The messagebox show the output but the label8 has no output at all
Posted
Comments
Mike Meinz 28-Feb-13 8:33am    
I copied your code and tried it on my PC and it works fine.

Please use Visual Studio Debugger and look at str.
What is the value in str after the Dim str As String statement?

This is the code that I used to test:

Dim args As String = "XXXXXXXX YYYYYYY ZZZZZZZZZZZZ"
Dim str As String = args.ToString
Dim bidask As String() = str.Split(" ")
MsgBox(bidask(1) & " / " & bidask(2))
Label1.Text = "" & bidask(1) & " / " & bidask(2)


Label1 shows YYYYYYY / ZZZZZZZZZZZZ after execution of above code.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900