如何将表单文本发送到模块

如何将表单文本发送到模块

本文介绍了如何将表单文本发送到模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我要在这里输入文字

 hi i want text here 

"name"
Public Property name() As String
        Get
            Return "name"
        End Get
        Set(value As String)
        End Set
    End Property

推荐答案

表格1

Public Class Form1

    Dim form2 As Form2
    Sub New()

        ' This call is required by the designer.
        InitializeComponent()

        ' Add any initialization after the InitializeComponent() call.
        form2 = New Form2(Me)

    End Sub


    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        form2.Show()
        Dim results As String = form2.GetData()

    End Sub
End Class

Form2

Public Class Form2


    Dim form1 As Form1
    Sub New(nform1 As Form1)
        ' This call is required by the designer.
        InitializeComponent()
        AddHandler Me.FormClosing, AddressOf Form2_FormClosing
        form1 = nform1
        form1.Hide()
    End Sub

    Private Sub Form2_FormClosing(sender As Object, e As FormClosingEventArgs)
        'stops form from closing
        E.Cancel = True
        Me.Hide()
    End Sub

    Public Function GetData() As String
        Return "The quick brown fox jumped over the lazy dog"
    End Function



End Class



这篇关于如何将表单文本发送到模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 07:58