Solved

How to take control on submit button automatically while data entered on txtpassword.

Posted on 2012-03-22
3
294 Views
Last Modified: 2012-03-23
I have two textboxes, txtusername and txtpassword.
when the user enters the password, the submit button should activated.
secondly when i click on submit button of login form, frmdetails form gets activated.
but how to close login form.
0
Comment
Question by:searchsanjaysharma
3 Comments
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 250 total points
ID: 37755900
Public Class mainForm

   ' handles login Button's Click event
   Private Sub loginButton_Click(ByVal sender As System.Object, _
      ByVal e As System.EventArgs) Handles loginButton.Click

      detailsForm.Show()
      Me.Hide()

   End Sub ' Button_Click
End Class ' mainForm
0
 
LVL 16

Accepted Solution

by:
Rose Babu earned 250 total points
ID: 37755987
Hi,

when an user enters the password in txtpassword textbox then the submit button will be activated. use txtpassword_KeyDown event to trigger it.
Private Sub txtpassword_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtpassword.KeyDown

	If e.KeyCode = Keys.Enter Then

		btnSubmit_Click(Me, EventArgs.Empty)

	End If

End Sub

Open in new window

when a submit button clicked then the login form will be hidded and the frmdetails form will be shown by using the below code.
Private Sub btnSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSubmit.Click

	Me.Hide()
	frmdetails .Show()

End Sub

Open in new window

Try this. It will work for you.
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 37756031
ok
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now