Click here to Skip to main content
16,004,854 members
Home / Discussions / C#
   

C#

 
GeneralRe: Changing code while debuging c# Application Pin
Russell Jones27-Sep-07 23:45
Russell Jones27-Sep-07 23:45 
AnswerRe: Changing code while debuging c# Application Pin
il_masacratore27-Sep-07 21:24
il_masacratore27-Sep-07 21:24 
GeneralRe: Changing code while debuging c# Application Pin
idreesbadshah27-Sep-07 21:28
idreesbadshah27-Sep-07 21:28 
GeneralRe: Changing code while debuging c# Application Pin
Urs Enzler27-Sep-07 22:55
Urs Enzler27-Sep-07 22:55 
AnswerRe: Changing code while debuging c# Application Pin
blackjack215027-Sep-07 21:51
blackjack215027-Sep-07 21:51 
QuestionHelp regarding cellclick event in datagridview Pin
anu8127-Sep-07 20:56
anu8127-Sep-07 20:56 
AnswerRe: Help regarding cellclick event in datagridview Pin
anu8129-Sep-07 0:38
anu8129-Sep-07 0:38 
QuestionButton.Click Handling Issue Pin
Sukhjinder_K27-Sep-07 20:18
Sukhjinder_K27-Sep-07 20:18 
I have one button and one listbox on same Form.

Inside InitializeComponent()
{

For button1 I have
this.button1.Click += new System.EventHandler(this.Button1Click);

and for listBox1 I have
this.listBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.ListBoxKeyUp);

}
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();

}

void Button1Click(object sender, EventArgs e)
{
Console.WriteLine("Btn Clicked");
this.listBox1.Focus();
}
void ListBoxKeyUp(Object sender, KeyEventArgs kev)
{
Console.WriteLine("List KeyUp");
// My Code to Handle the Key Up
}
}

On Running the App and Pressing Enter on button1
The Output is
Btn Clicked
List KeyUp

All I actually wanted was to give (in button1's Click Event) the Focus to listbox1 and return. My listbox is actually a playlist and whenver Enter is pressed on it the selected entry starts to play. Only one click (via Keyboard) was made on button1 but listbox1's KeyUp Event also is getting fired.

Please Advice
Thanks...

P.S. The Code Works fine if button1 is clicked via Mouse
AnswerRe: Button.Click Handling Issue Pin
Christian Graus27-Sep-07 20:19
protectorChristian Graus27-Sep-07 20:19 
GeneralExpected Scenario Explained Pin
Sukhjinder_K27-Sep-07 20:57
Sukhjinder_K27-Sep-07 20:57 
AnswerRe: Button.Click Handling Issue Pin
Sukhjinder_K27-Sep-07 22:13
Sukhjinder_K27-Sep-07 22:13 
GeneralRe: Button.Click Handling Issue Pin
Christian Graus27-Sep-07 22:30
protectorChristian Graus27-Sep-07 22:30 
GeneralRe: Button.Click Handling Issue Pin
Sukhjinder_K27-Sep-07 22:54
Sukhjinder_K27-Sep-07 22:54 
QuestionListView Gridline color Pin
sibiks27-Sep-07 20:07
sibiks27-Sep-07 20:07 
AnswerRe: ListView Gridline color Pin
dengboo27-Sep-07 20:11
dengboo27-Sep-07 20:11 
GeneralRe: ListView Gridline color Pin
sibiks27-Sep-07 20:17
sibiks27-Sep-07 20:17 
QuestionWhat is the substitute of #define directive in C#? Pin
Mushtaque Nizamani27-Sep-07 18:53
Mushtaque Nizamani27-Sep-07 18:53 
AnswerRe: What is the substitute of #define directive in C#? Pin
Christian Graus27-Sep-07 18:56
protectorChristian Graus27-Sep-07 18:56 
GeneralRe: What is the substitute of #define directive in C#? Pin
Mushtaque Nizamani27-Sep-07 19:20
Mushtaque Nizamani27-Sep-07 19:20 
GeneralRe: What is the substitute of #define directive in C#? Pin
Christian Graus27-Sep-07 19:34
protectorChristian Graus27-Sep-07 19:34 
AnswerRe: What is the substitute of #define directive in C#? Pin
Rocky#27-Sep-07 18:58
Rocky#27-Sep-07 18:58 
AnswerRe: What is the substitute of #define directive in C#? Pin
Guffa27-Sep-07 20:08
Guffa27-Sep-07 20:08 
GeneralRe: What is the substitute of #define directive in C#? Pin
Rocky#27-Sep-07 21:00
Rocky#27-Sep-07 21:00 
AnswerRe: What is the substitute of #define directive in C#? Pin
Guffa27-Sep-07 20:15
Guffa27-Sep-07 20:15 
AnswerRe: What is the substitute of #define directive in C#? Pin
PIEBALDconsult28-Sep-07 5:10
mvePIEBALDconsult28-Sep-07 5:10 

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.