调用参数过多的方法-新手(可能) [英] Calling a method with too many parameters - Newbie (probably)
本文介绍了调用参数过多的方法-新手(可能)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何正确书写??
它说了很多论点,所以我要怎么写而没有错误呢??
how to write that correctly???
It says to many arguments so how am I going to write that without error???
For i As Integer = 1 To 10 Step 1
cboCategoryName.Items.Add(frmSuppliers.txtFName.Text, frmSuppliers.txtMName.Text, frmSuppliers.txtLName.Text)
Next
然后,它说设置DataSource属性时不能修改Items集合.
我为此使用绑定,但是当我绑定它时,我只能在3个文本框中显示一个文本,如何使它显示3个文本.
It then says that Items collection cannot be modified when the DataSource property is set.
I use binding for this but when I bind it I could only display one text among the 3 textboxes how am I going to make it display the 3 text.
推荐答案
使用VS intellisense知道需要在其中添加哪些参数(类型和数字).
看起来像这样:
Use VS intellisense to know what paramters (type and number) needs to be added there.
Looks like, this might fit:
For i As Integer = 1 To 10 Step 1
cboCategoryName.Items.Add(frmSuppliers.txtFName.Text & frmSuppliers.txtMName.Text & frmSuppliers.txtLName.Text)
Next
这对您来说并不是一个好主意.您的主题行应具有足够的描述性,以表明您要查找的内容.
应该是
This is not really a good subject line for you. Your subject line should be descriptive enough to indicate what you are looking for.
It should be
For i As Integer = 1 To 10
cboCategoryName.Items.Add(String.Format("{0} {1} {2}, frmSuppliers.txtFName.Text, frmSuppliers.txtMName.Text, frmSuppliers.txtLName.Text)
Next
项目集合有1个参数.如果要在其项目集合中添加一个句子,则需要进行合并.
Item collection takes 1 argument. If you are going to add a sentence to its item collection, you need to concat.
这篇关于调用参数过多的方法-新手(可能)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文