有关VB.NET的两个问题

[复制链接]
查看11 | 回复4 | 2013-5-31 04:07:53 | 显示全部楼层 |阅读模式
你的2个问题可以合并成一个函数来解决。下面给出的这个函数复制到你工程里,直接用就行了。' 这个函数会查找指定控件下的指定名称的子控件Private Shared Function GetContrlByName(ByVal Parent As Control, ByVal Name As String) As Control
Name = Name.ToLower()
' 查询当前的子控件
For Each iContrl As Control In Parent.Controls
If iContrl.Name.ToLower() = Name Then
Return iContrl
...
回复

使用道具 举报

千问 | 2013-5-31 04:07:53 | 显示全部楼层
Inherits System.Web.UI.Page
Protected Sub button10_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button10.Click
Me.FindButton(Me)
Response...
回复

使用道具 举报

千问 | 2013-5-31 04:07:53 | 显示全部楼层
楼上vb.net 需要搞这么复杂吗?很简单的语句就可以搞定了。第一个问题,
Dim abc As Button
For Each abc In Me.Controls '这里的me是窗体。
MsgBox(abc.Name)
Next第二个问题
dim ...
回复

使用道具 举报

千问 | 2013-5-31 04:07:53 | 显示全部楼层
vb.net 需要搞这么复杂吗?很简单的语句就可以搞定了。第一个问题,
Dim abc As Button
For Each abc In Me.Controls '这里的me是窗体。
MsgBox(abc.Name)
Next第二个问题
dim i as Boolean
i=Me...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行