CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: Evaluate

  1. #1
    Guest

    Evaluate

    Hello,
    I have 12 text boxes. When the "LostFocus" event is triggered, I call a sub routine (see below) "OrderTickers".
    I need to capture the the actual text in box X (1-12). Currently my variable is returning the string 'txtTick1.Text' instead of 'AMZN'. How can I capture the string that is in txtTick1.Text?


    private Sub OrderTickers(tickNum as Integer)
    Dim ii as Integer
    Dim MyVal
    Dim curVal

    curVal = "txtTick" & tickNum & ".Text"
    for ii = 1 to 12
    MyVal = "txtTick" & ii & ".Text" 'eg: txtTick1.Text (I need to see AMZN)
    If len(Trim(MyVal)) > 1 then
    MyVal = curVal
    End If
    next

    End Sub






  2. #2
    Join Date
    Jul 1999
    Posts
    35

    Re: Evaluate

    It is much easier if your text box only diffrent in the index number.. in this case u r using the same name for the text box but differ in index.. so what u've to do is call the textbox by index num.. like this text1(x).text where x is index


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured