Click here to Skip to main content
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 3: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 OriginalGriff 7,800
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,790


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