Click here to Skip to main content
11,721,053 members (81,266 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: 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 2:09am
Comments
Mike Meinz at 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
0 Sergey Alexandrovich Kryukov 500
1 OriginalGriff 334
2 Mika Wendelius 160
3 F-ES Sitecore 140
4 Maciej Los 80
0 Sergey Alexandrovich Kryukov 2,199
1 OriginalGriff 959
2 F-ES Sitecore 640
3 Maciej Los 609
4 Richard MacCutchan 540


Advertise | Privacy | Mobile
Web03 | 2.8.150901.1 | Last Updated 28 Feb 2013
Copyright © CodeProject, 1999-2015
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