Click here to Skip to main content
16,006,440 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to restore the default base path after using an open file dialog Pin
Dave Kreskowiak25-Jan-07 10:27
mveDave Kreskowiak25-Jan-07 10:27 
GeneralRe: How to restore the default base path after using an open file dialog Pin
Martin#25-Jan-07 19:36
Martin#25-Jan-07 19:36 
GeneralRe: How to restore the default base path after using an open file dialog Pin
Dave Kreskowiak26-Jan-07 2:23
mveDave Kreskowiak26-Jan-07 2:23 
GeneralRe: How to restore the default base path after using an open file dialog Pin
Martin#26-Jan-07 3:15
Martin#26-Jan-07 3:15 
AnswerRe: How to restore the default base path after using an open file dialog Pin
Marc Clifton25-Jan-07 12:21
mvaMarc Clifton25-Jan-07 12:21 
Questiongetting the enter key to act as a button click Pin
Rocky#25-Jan-07 8:30
Rocky#25-Jan-07 8:30 
AnswerRe: getting the enter key to act as a button click Pin
Pete O'Hanlon25-Jan-07 8:42
mvePete O'Hanlon25-Jan-07 8:42 
AnswerRe: getting the enter key to act as a button click Pin
Martin#25-Jan-07 9:02
Martin#25-Jan-07 9:02 
Hello,

Don't know if I understand you write.

But I think in this case, in the TextBox for the password or in both Textboxes (name and password) there is the KeyDown or KeyUp event watched.

like this example with two textboxes and one button:

//Button Click event
this.button.Click += new System.EventHandler(this.button_Click);
  
//TextBoxes KeyDown event
this.tbName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox_KeyDown);
this.tbPassword.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox_KeyDown);
  
//Here is the validation method (your code)
private void Validating()
{
    //code
}
  
//All events call the same method
private void button3_Click(object sender, System.EventArgs e)
{
    Validating();
} 
  
private void textBox_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
    //Only if Enter is pressed
    if(e.KeyCode == System.Windows.Forms.Keys.Enter)
    {
	Validating();
    }
}


Hope I got you write!

All the best,

Martin
GeneralRe: getting the enter key to act as a button click Pin
bobsugar22225-Jan-07 23:50
bobsugar22225-Jan-07 23:50 
GeneralRe: getting the enter key to act as a button click Pin
Martin#26-Jan-07 0:18
Martin#26-Jan-07 0:18 
GeneralRe: getting the enter key to act as a button click Pin
bobsugar22226-Jan-07 2:44
bobsugar22226-Jan-07 2:44 
GeneralRe: getting the enter key to act as a button click Pin
Martin#26-Jan-07 3:28
Martin#26-Jan-07 3:28 
QuestionHow to Create TCP Server reply to a client using XML file Pin
Janani Vaithyanathan25-Jan-07 7:35
Janani Vaithyanathan25-Jan-07 7:35 
AnswerRe: How to Create TCP Server reply to a client using XML file Pin
Marc Clifton25-Jan-07 8:27
mvaMarc Clifton25-Jan-07 8:27 
GeneralRe: How to Create TCP Server reply to a client using XML file Pin
Janani Vaithyanathan26-Jan-07 7:55
Janani Vaithyanathan26-Jan-07 7:55 
QuestionUsing Combo Box in a GridView Pin
rahul_spi25-Jan-07 7:19
rahul_spi25-Jan-07 7:19 
AnswerRe: Using Combo Box in a GridView Pin
netJP12L25-Jan-07 7:51
netJP12L25-Jan-07 7:51 
GeneralRe: Using Combo Box in a GridView Pin
rahul_spi31-Jan-07 17:37
rahul_spi31-Jan-07 17:37 
Questionsend fax with C# Pin
Eddymvp25-Jan-07 6:57
Eddymvp25-Jan-07 6:57 
QuestionString operation issue Pin
Saira Tanwir25-Jan-07 6:13
Saira Tanwir25-Jan-07 6:13 
AnswerRe: String operation issue Pin
Luc Pattyn25-Jan-07 6:18
sitebuilderLuc Pattyn25-Jan-07 6:18 
GeneralRe: String operation issue Pin
Saira Tanwir25-Jan-07 6:58
Saira Tanwir25-Jan-07 6:58 
GeneralRe: String operation issue Pin
ednrgc25-Jan-07 7:49
ednrgc25-Jan-07 7:49 
GeneralRe: String operation issue Pin
Luc Pattyn25-Jan-07 7:57
sitebuilderLuc Pattyn25-Jan-07 7:57 
AnswerRe: String operation issue Pin
andykernahan25-Jan-07 9:08
andykernahan25-Jan-07 9:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.