'AddressOf'操作数必须是方法的名称;没有括号a [英] 'AddressOf' operand must be the name of a method; no parentheses a
问题描述
大家好
我的TreeView菜单出错了(我希望有一个按钮,带有
ExpandALL和CollapseALL): -
错误: -
''AddressOf''操作数必须是方法的名称;不需要括号。
我使用VB.Net并且我更改了C#代码: -
private void ExpandAll()
{
for(int i = 0; i< yourTree.Nodes.Count; i ++)
{
yourTree.Nodes [ i] .Expanded = true;
}
}
要
Public Sub ExpandAll( )
Dim i As Integer
For i = 0 to tvFamilyTree.Nodes.Count - 1步i + 1
tvFamilyTree.Nodes(i ).Expanded = True
下一页
结束子
并在页面加载中调用ExapndAll
在我的ASP.NET页面上这样称为: -
< asp:Button BorderColor =#009966 Runat = server
OnClick =" ExpandAll()" >< / asp:按钮>
你能告诉我出错了什么!!
Thx
Hi All
i''m getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
''AddressOf'' operand must be the name of a method; no parentheses are needed.
I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO
Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
Can u telling me what ''m doing wrong!!
Thx
推荐答案
" Patrick.O.Ige" <帕********* @ discussions.microsoft.com>在留言中写道
新闻:F4 ********************************** @ microsof t.com ...
"Patrick.O.Ige" <Pa*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
大家好我的TreeView菜单出错了(我想要一个带有
ExpandALL和CollapseALL的按钮): -
''AddressOf''操作数必须是方法的名称;不需要括号。
我使用VB.Net并且我更改了C#代码: -
private void ExpandAll()
{
for (int i = 0; i< yourTree.Nodes.Count; i ++)
{
yourTree.Nodes [i] .Expanded = true;
}
} > TO
Public Sub ExpandAll()
Dim i As Integer
对于i = 0到tvFamilyTree.Nodes.Count - 1步i + 1
tvFamilyTree.Nodes (i).Expanded = True
下一页
End Sub
Hi All
i''m getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
''AddressOf'' operand must be the name of a method; no parentheses are
needed.
I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO
Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
我不知道,除了VB代码与c#代码不匹配。这个代码片段的VB
等价物是:
Public Sub ExpandAll()
For i Integer = 0 to tvFamilyTree。 Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
大卫
I have no idea, except that the VB code does not match the c# code. The VB
equivilent of that snippet is:
Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
David
嗨大卫,
Thx for the snippet。我尝试了但仍然给出错误!!
确切的错误是: -
AddressOf''操作数必须是方法的名称;不需要括号。
AddHandler __ctrl.Click,AddressOf Me.ExpandAll()
任何帮助!
" David布朗"写道:
Hi David,
Thx for the snippet.I tried it but still giving the error!!
The exact error is :-
AddressOf'' operand must be the name of a method; no parentheses are needed.
AddHandler __ctrl.Click, AddressOf Me.ExpandAll()
Any help!
"David Browne" wrote:
Patrick.O.Ige <帕********* @ discussions.microsoft.com>在消息中写道
新闻:F4 ********************************** @ microsof t.com。 ..
"Patrick.O.Ige" <Pa*********@discussions.microsoft.com> wrote in message
news:F4**********************************@microsof t.com...
大家好我的TreeView菜单出错了(我想要一个带有
ExpandALL和CollapseALL的按钮): -
错误: -
''AddressOf''操作数必须是方法的名称;不需要括号。
我使用VB.Net并且我更改了C#代码: -
private void ExpandAll()
{
for (int i = 0; i< yourTree.Nodes.Count; i ++)
{
yourTree.Nodes [i] .Expanded = true;
}
} > TO
Public Sub ExpandAll()
Dim i As Integer
对于i = 0到tvFamilyTree.Nodes.Count - 1步i + 1
tvFamilyTree.Nodes (i).Expanded = True
下一页
End Sub
Hi All
i''m getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
''AddressOf'' operand must be the name of a method; no parentheses are
needed.
I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO
Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
我不知道,除了VB代码与c#代码不匹配。该片段的VB
相当于:
Public Sub ExpandAll()
对于i as Integer = 0到tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes (i).Expanded = True
下一页
David
I have no idea, except that the VB code does not match the c# code. The VB
equivilent of that snippet is:
Public Sub ExpandAll()
For i As Integer = 0 To tvFamilyTree.Nodes.Count - 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
David
嗨Patrcik,
修改代码行
< asp:Button BorderColor =#009966 Runat = server
OnClick =" ExpandAll( )">< / asp:Button>
to
< asp:Button BorderColor =#009966 Runat = server
OnClick = QUOT; ExpandAll">< / ASP:按钮>并检查。
你不需要在这里给出一个括号。
HTH
srini
" Patrick.O.Ige"写道:
Hi Patrcik,
Modify the line of code
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
to
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll"></asp:Button> and check.
You dont need to give a parenthesis here.
HTH
srini
"Patrick.O.Ige" wrote:
大家好
我的TreeView菜单出错(我想要一个带有
ExpandALL和CollapseALL的按钮): -
''AddressOf''操作数必须是方法的名称;不需要括号。
我使用VB.Net并且我更改了C#代码: -
private void ExpandAll()
{
for(int i = 0; i< yourTree.Nodes.Count; i ++)
{
yourTree.Nodes [i] .Expanded = true;
}
}
TO
Public Sub ExpandAll()
Dim i As Integer
对于i = 0到tvFamilyTree.Nodes.Count - 1步i + 1
tvFamilyTree.Nodes(i)。 Expanded = True
下一页
在页面加载中调用ExapndAll
在我的ASP.NET页面上调用它如下: -
< ; asp:Button BorderColor =#009966 Runat = server
OnClick =" ExpandAll()">< / asp:Button>
你能告诉我这是做什么的吗?错误!!
Thx
Hi All
i''m getting error with my TreeView Menu(I want to have a button with
ExpandALL and CollapseALL):-
Error:-
''AddressOf'' operand must be the name of a method; no parentheses are needed.
I use VB.Net and i changed the C# code from:-
private void ExpandAll()
{
for(int i=0; i < yourTree.Nodes.Count; i++)
{
yourTree.Nodes[i].Expanded = true;
}
}
TO
Public Sub ExpandAll()
Dim i As Integer
For i = 0 To tvFamilyTree.Nodes.Count - 1 Step i + 1
tvFamilyTree.Nodes(i).Expanded = True
Next
End Sub
And called ExapndAll in page load
And on my ASP.NET page called it like this:-
<asp:Button BorderColor=#009966 Runat=server
OnClick="ExpandAll()"></asp:Button>
Can u telling me what ''m doing wrong!!
Thx
这篇关于'AddressOf'操作数必须是方法的名称;没有括号a的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!