以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  如何在实现Label中的显示,谢谢!  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=53670)

--  作者:zstk7333
--  发布时间:2014/7/12 22:46:00
--  如何在实现Label中的显示,谢谢!

我想实现在窗口中的Label中可以分行显示结果,如何实现?谢谢。窗口中的按钮有我的代码,可以在命令窗口中看到我想输出的结果。

\'\'\'
Dim ts As List(of String)
ts = DataTables("表A").GetValues("第一列")
Dim t2s As List(of String)
t2s = DataTables("表B").GetValues("第二列")
For Each t As String In ts
    For a As Integer = 0 To t2s.Count-1
        If t = t2s(a) Then
            Dim dr As DataRow
            dr = DataTables("表B").Find("第二列 = \'" & t2s(a) & "\'")
            Dim r As Integer
            r = Tables("表B").FindRow(dr)
            If r>=0 Then
                Tables("表B").Position = r
            End If
            Output.Show("Find  " & t & "-" &Tables("表B").Rows(r)("第一列"))
        End If
    Next
Next

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目4.rar


--  作者:y2287958
--  发布时间:2014/7/13 0:23:00
--  
\'\'\'
Dim ts As List(of String)
ts = DataTables("表A").GetValues("第一列")
Dim t2s As List(of String)
t2s = DataTables("表B").GetValues("第二列")
Dim qq As String
For Each t As String In ts
    For a As Integer = 0 To t2s.Count-1
        If t = t2s(a) Then
            Dim dr As DataRow
            dr = DataTables("表B").Find("第二列 = \'" & t2s(a) & "\'")
            Dim r As Integer
            r = Tables("表B").FindRow(dr)
            If r>=0 Then
                Tables("表B").Position = r
            End If
            Output.Show("Find  " & t & "-" &Tables("表B").Rows(r)("第一列"))
            qq += "Find  " & t & "-" &Tables("表B").Rows(r)("第一列") & vbcrlf
        End If
    Next
Next
Dim l As WinForm.Label = Forms("窗口1").Controls("Label1")
l.Text = qq

--  作者:zstk7333
--  发布时间:2014/7/13 0:25:00
--  回复:(y2287958)'''Dim ts As List(of String)ts =...

谢谢指教,完美解决。不过还要请教一下:qq += "Find  " & t & "-" &Tables("表B").Rows(r)("第一列") & vbcrlf  这句中的“+=”怎么解释?谢谢

[此贴子已经被作者于2014-7-13 0:26:59编辑过]

--  作者:zyqzyy
--  发布时间:2014/7/13 3:08:00
--  
类似 qq=qq & qq......