Foxtable(狐表)用户栏目专家坐堂 → [讨论]关于下拉窗口直接输入的问题


  共有5009人关注过本帖树形打印复制链接

主题:[讨论]关于下拉窗口直接输入的问题

帅哥哟,离线,有人找我吗?
lsy
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2013/5/28 16:30:00 [显示全部帖子]

换个角度看问题,以下是我的通用录入框对于不允许直接输入的控制:

    If e.Form.Controls("TreeView录入树").AllNodes.Count < 1 Then
        MessageBox.Show("没有选择数据")
        e.Form.DropDownBox.Text = ""
    ElseIf e.Form.Controls("TreeView录入树").AllNodes.Count > = 1 Then
        Dim trv As WinForm.TreeView = e.Form.Controls("TreeView录入树")
        Dim i As Integer = 0
        For Each nd As WinForm.TreeNode In trv.AllNodes
            If nd.Level = 0 AndAlso e.Form.DropDownBox.Text = nd.Name Then
                i = i + 1
            End If
        Next
        If i = 0 Then
            MessageBox.Show("没有选择数据")
            e.Form.DropDownBox.Text = ""
        End If
    End If


 回到顶部