Results 1 to 12 of 12

Thread: shorten arg number ?? {Sorted by Edneeis}

Threaded View

  1. #1

    Thread Starter
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

    shorten arg number ?? {Sorted by Edneeis}

    I dunno how to explain this but I will try to be clear :
    how can I declare array of textbox . I prefer you look at what I am trying to do :
    VB Code:
    1. Public Function Save(ByVal txt1 As TextBox, ByVal txt2 As TextBox, ByVal txt3 As TextBox, ByVal txt4 As TextBox, ByVal txt5 As TextBox, ByVal txt6 As TextBox, ByVal comb1 As ComboBox, ByVal comb2 As ComboBox)  
    2.  
    3. MyAdapter.Fill(MyDataset, "MyTab")
    4. Dim MyDataRow As DataRow = MyDataset.Tables("MyTab").NewRow
    5. MyDataRow("C_URL") = txt1.Text
    6. MyDataRow("C_Category") = comb1.Text
    7. MyDataRow("C_language") = comb2.Text
    8. MyDataRow("C_username") = txt3.Text
    9. .                         txt4.Text
    10. .                         txt5.Text
    11. .                         txt6.Text
    12. End Function
    13.  
    14. ' Call it like so :
    15.  
    16. Save(TextBox1, TextBox2, TextBox3, TextBox4, TextBox5, TextBox6, ComboBox1, ComboBox2)

    is there another way to shorten this by declaring a collection of textbox ? Is it possible or Do I need to sleep ?
    Last edited by Pirate; Jan 20th, 2003 at 09:03 PM.

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