Solved

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

Posted on 2012-03-22
3
296 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

791 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