帮我一个例子plss [英] Help me with an examples plss

查看:66
本文介绍了帮我一个例子plss的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Look Guys ..

让我的问题清楚

我有两种形式..

表格1:1个文本框和1个按钮(按钮不显示用户在txtbox中输入的名称,但打开表单2)

表单2:1 txtbox和按钮,(在txtbox表单1用户输入名称)在此txtbox表单2中用户输入他的姓氏...该按钮将显示一个msgbox,显示名称和姓氏..





我该怎么办?它?





我试过像这样:但它没有用完:/



Look Guys ..
To make my problem clear
I have two forms..
Form 1: 1 textbox and 1 button ( button don''t show the name that user enter in txtbox but open form 2)
Form 2: 1 txtbox and button, (in txtbox form 1 user enter name) in this txtbox form 2 the user enter his lastname...The button will show a msgbox wich show up the name and lastname..


how can i do it?


I tried like thi: but it doesn''t work out :/

Private Sub Command1_Click()
Static name As Integer
Static lastname As Integer
firstname = txtFirstName.Text
LastName = txtLastName.Text
txtFirstName.Text = Form1.txtFirstName.Text
txtLastName.Text = Form2.txtLastName.Text

both = (Form1.txtFirstName.Text " & & " Form2.txtLastName.Text)
MsgBox (both)

End Sub

推荐答案

适用于VB.Net,不适用于经典VB ...

Applicable for VB.Net, Not applicable For Classic VB...
Public Class Form2
    Public FirstName As String
    Private Sub Command1_Click() Handles Command1.Click
        Dim LastName As String
        Dim Both As String
        LastName = txtLastName.Text  'Replace txtLastName with Name of Your TextBox

        both = (FirstName & LastName)
        MsgBox (Both)
End Sub
End Class





在Form1中编写代码如下



In Form1 Write code as Follows

Public Class Form1
    Private Sub Command1_Click() Handles Command1.Click
        Form2.FirstName = txtFirstName.Text  'Replace txtFirstName with Name of Your TextBox
        Form2.Show()
        Me.Close
End Sub
End Class






您可以将值保存在变量全局类型中,然后以消息框格式保存在第二页上,您可以调用姓氏值,然后调用全局值或任何您想要的格式。



希望它能帮到你。



谢谢。
Hi,

You can hold the value in a variable global type then on second page in messagebox format you can call the the last name value then global value or whatever format you want.

hope it ll help you.

Thanks.


这篇关于帮我一个例子plss的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆