Solved

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

Posted on 2012-03-22
3
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

739 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