Foxtable(狐表)用户栏目专家坐堂 → [求助]如何生成随机长度的WBS编号


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

主题:[求助]如何生成随机长度的WBS编号

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


加好友 发短信
等级:二尾狐 帖子:574 积分:4252 威望:0 精华:0 注册:2015/5/13 8:32:00
  发帖心情 Post By:2016/7/29 12:12:00 [显示全部帖子]

 For i As Integer = 1 To 3
    Dim str As String = "1." &i
    output.show(str)
    For i2 As Integer = 1 To 3
        Dim str2 As String = str & "." & i2
        If Rand.Next(2)>0 Then
            output.show(str2)
            Continue For
        End If
        
        For i3 As Integer = 1 To 3
            Dim str3 As String = str2 & "." & i3
            If Rand.Next(8)> 0 Then
                output.show(str3)
            End If
        Next
    Next
Next

 回到顶部
帅哥哟,离线,有人找我吗?
cbt
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:574 积分:4252 威望:0 精华:0 注册:2015/5/13 8:32:00
  发帖心情 Post By:2016/7/29 12:38:00 [显示全部帖子]

Dim tv As WinForm.TreeView = Forms("窗口1").Controls("TreeView1")
tv.Nodes.Clear
Dim nd As WinForm.TreeNode =  tv.Nodes.Add("1")
For i As Integer = 1 To 3
    Dim str As String = "1." &i
    Dim nd2 As WinForm.TreeNode = nd.Nodes.Add(i)
    For i2 As Integer = 1 To 3
        Dim str2 As String = str & "." & i2
        Dim nd3 As WinForm.TreeNode
        If Rand.Next(2)>0 Then
            nd3 = nd2.nodes.Add(i2)
            Continue For
        End If
        For i3 As Integer = 1 To 3
            Dim str3 As String = str2 & "." & i3
            If Rand.Next(8)> 0 Then
                If nd3 IsNot Nothing Then
                    nd3.nodes.Add(i3)
                End If
            End If
        Next
    Next
Next
tv.ExpandAll

 回到顶部