Basic中的文本框和保存按钮

Basic中的文本框和保存按钮

本文介绍了Visual Basic中的文本框和保存按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我是Visual Basic的新手,所以我在这里有疑问.

我创建了一个表单,其中有3个文本框,分别是:名称,姓氏和地址.在下面,用户必须单击一个按钮,该信息将被保存到驱动器C.

Hello, I am new to Visual Basic so I have so me questions here.

I have created a form where there are 3 textboxes namely: Name, Last Name and Address. And below there is a button where the user has to click, the information will be saved to drive C.

推荐答案

Form Load()

   btnSave.enable=False

End Sub




(b)将以下代码放在TextBox更改事件上
(假设您的姓名,姓氏和地址文本框名称分别为txtName,txtLName和ampxAddress)






(b) Placed following code on the TextBox(s) changing event
(Assuming that ur Name, Last Name and Address Textboxes names are txtName, txtLName & txtAddress respectively)



Private Sub txtName_Changing(ByVal sender As Object, ByVal e As System.EventArgs)

        If Not txtName.Text = "" Then
            btnSave.Enabled = True
        End If

Private Sub txtLName_Changing(ByVal sender As Object, ByVal e As System.EventArgs)

        If Not txtLName.Text = "" Then
             btnSave.Enabled = True
        End If

Private Sub txtAddress_Changing(ByVal sender As Object, ByVal e As System.EventArgs)

        If Not txtAddress.Text = "" Then
             btnSave.Enabled = True
        End If



使用以下方法之一解决您的问题.



Use One of these method to solve ur problem.




这篇关于Visual Basic中的文本框和保存按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 01:08