Click here to Skip to main content
12,761,424 members (38,885 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: VB VB.NET

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 28-Feb-13 3:09am
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)

    Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.170217.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100