2011-01-06 144 views
0

我使用窗体中的面板,面板包含一个文本框,窗体包含另一个文本框。当我点击确定按钮的面板,病隐藏和形式显示,面板中的文本框的值被转移到另一个文本框在相同的形式。请帮助任何人。如何将值从一个文本框复制到另一个不同的两个窗体vb.net2008的文本框?

+0

帮助我,我试图使用= Me.Text,但这是窗体,而不是文本框。感谢您的询问。 – JeopardyTempest 2016-11-14 20:54:17

回答

2

在简单按钮点击事件: -

Text2.Text = Text1.Text

+0

谢谢你,先生提供这个想法..工作.. – 2011-01-07 05:00:22

0

,如果我理解正确的,我不知道,我做了一个小例子 你好法布里奇奥

<asp:Panel ID="Panel1" runat="server"> 
     <div> 
     <asp:Label ID="Label1" runat="server" Text="Testo 1"></asp:Label> 
     &nbsp; 
     <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> 
     </div> 
    </asp:Panel> 


     <div> 
     <asp:Label ID="Label2" runat="server" Text="Testo 2"></asp:Label> 
     &nbsp; 
     <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
     </div> 

     <div> 
     <asp:Button ID="Button1" runat="server" Text="Button" /> 
     </div> 

Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click 
     Dim str1 As String = Me.TextBox1.Text 
     Me.Panel1.Visible = False 
     Me.TextBox2.Text = str1 
    End Sub 
0
Public Shared Function GrabURL(ByRef value As String) As String 
    If (value Is Nothing) Then 
     Return "" 
    Else 
     Return Regex.Match(value, "(http://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?)").Value 
    End If 
End Function 

' if empty string is added: 
FForm2.ListView1.Items.Add(New ListViewItem(GrabURL(RichTextBox1.Text))) 

' if empty URL should be ignored: 
dim lviURL as New ListViewItem(GrabURL(RichTextBox1.Text)) 
if lviURL .Text <>"" then FForm2.ListView1.Items.Add(lviURL) 
相关问题