VB.NET以外部形式将数据添加到文本框

时间:2017-09-09 17:00:48

标签: vb.net

再次问好StackOverflow社区。  我需要将外部生成的表单中的文本添加到TextBox中。

我的代码(用于生成新表单):

Public Sub NewPage()
        Dim newtab As New CenterForm1
        newtab.MdiParent = Me
        newtab.Show(DockPanel1)
        newtab.ComID.Text = newtab.codeblock.Name
        newtab.codeblock.Name = +count
        newtab.Name = +count
        count += 1
    End Sub

我的代码(用于向TextBox插入文本):

Dim GetActive As GetActiveWindow
Dim codeblock As New TextBox
GetActive.codeblock.Text = "TESTIIIING"

代码" GetActivateWindow"类

Imports WeifenLuo.WinFormsUI.Docking

Public Class GetActiveWindow
    Public Property codeblock As TextBox

    Public Function GetActive()
        'Verify if forms that dock in main window are already open

        For Each form As DockContent In Form1.DockPanel1.Contents
            If form.DockHandler.Pane.ActiveContent.DockHandler.Form.Name.ToString() = form.Name.ToString() Then
                Dim formName As String = form.Name.ToString()
                Return formName
            End If
        Next
        Return Nothing
    End Function
End Class

有什么想法吗?

0 个答案:

没有答案