3 Replies - 995 Views - Last Post: 09 September 2011 - 01:27 AM Rate Topic: -----

#1 syncupsolutions  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 04-May 11

Question for New List(Of String)

Posted 08 September 2011 - 08:12 PM

Im working on a lay-away form application, this particular part is part of the even where the user adds a new customer, and has come to the section for adding personal references to the customers account. What Im trying to do is to check all the text boxes inside the GroupBox control, and then add all the tags of the text boxes that are empty to the list. If the list holds any records it will be put into a message box to let the user know he missed this value. But I want them to list in one text box. Here is what I've tried:

    Dim lst As New List(Of String)
        Dim txt As TextBox
        For Each txt In GroupBox5.GetAllTextBoxes
            lst.Add(txt.Tag)
        Next
          MsgBox(lst)




I get a conversion error, Cannot convert Prompt to String

Any ideas ?

Is This A Good Question/Topic? 0
  • +

Replies To: Question for New List(Of String)

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: Question for New List(Of String)

Posted 08 September 2011 - 09:17 PM

Your trying to pass a List (Of String) to a msgbox. What are you wanting to display?
Was This Post Helpful? 0
  • +
  • -

#3 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 225
  • View blog
  • Posts: 1,526
  • Joined: 16-March 11

Re: Question for New List(Of String)

Posted 08 September 2011 - 09:17 PM

Try
For each txt in groupbox5.controls
lst.add(txt.tag)
Next
Messagebox.show('whatever you need, but not lst as it will not work')



Each textbox is a control, so you're looking through the controls inside the groupbox. :)

This post has been edited by trevster344: 08 September 2011 - 09:22 PM

Was This Post Helpful? 0
  • +
  • -

#4 syncupsolutions  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 53
  • Joined: 04-May 11

Re: Question for New List(Of String)

Posted 09 September 2011 - 01:27 AM

I have no trouble looping through the controls, it's returning all the values of the list, in one single msgbox. There is three groupboxes inside groupbox5, Reference 1, 2, and 3. Each group box is identical visually. All ask for Full Name, relationship, years known, and phone number(splir into three text boxes for area, city code and number. If certain values are missing when the Cashier fills out the form - the msgbox will contain something like:

Some required fields have been left blank. Press skip to make an exception for "customername", or correct the following values in the appropriate sections:

Reference #!
First Name

Reference #3
Invalid Phone Number
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1