Click here to Skip to main content
15,889,281 members
Home / Discussions / C#
   

C#

 
GeneralOnEnter Event Pin
Agyeman22-Aug-05 4:07
Agyeman22-Aug-05 4:07 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 4:32
miah alom22-Aug-05 4:32 
GeneralRe: OnEnter Event Pin
Agyeman22-Aug-05 5:01
Agyeman22-Aug-05 5:01 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 5:02
miah alom22-Aug-05 5:02 
GeneralRe: OnEnter Event Pin
miah alom22-Aug-05 5:59
miah alom22-Aug-05 5:59 
GeneralRe: OnEnter Event Pin
Agyeman22-Aug-05 8:02
Agyeman22-Aug-05 8:02 
GeneralRe: OnEnter Event Pin
nidhelp22-Aug-05 22:02
nidhelp22-Aug-05 22:02 
GeneralRe: OnEnter Event Pin
Agyeman23-Aug-05 2:44
Agyeman23-Aug-05 2:44 
Checkout the example below and make sure u have included all the libraries.

Sample project

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace WindowsApplication1
{
///
/// Summary description for Form1.
///
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.ListBox listBox1;
///
/// Required designer variable.
///
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
this.textBox1 = new System.Windows.Forms.TextBox();
this.listBox1 = new System.Windows.Forms.ListBox();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(88, 32);
this.textBox1.Name = "textBox1";
this.textBox1.TabIndex = 0;
this.textBox1.Text = "textBox1";
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyDown);
//
// listBox1
//
this.listBox1.Location = new System.Drawing.Point(72, 88);
this.listBox1.Name = "listBox1";
this.listBox1.Size = new System.Drawing.Size(120, 95);
this.listBox1.TabIndex = 1;
//
// Form1
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 266);
this.Controls.Add(this.listBox1);
this.Controls.Add(this.textBox1);
this.Name = "Form1";
this.Text = "Form1";
this.ResumeLayout(false);

}
#endregion

///
/// The main entry point for the application.
///
[STAThread]
static void Main()
{
Application.Run(new Form1());
}

private void textBox1_KeyDown(object sender, System.Windows.Forms.KeyPressEventArgs e)
{
if (e.KeyChar == (char)Keys.Enter )
{
this.listBox1.Items.Add(this.textBox1.Text );
}
}
}
}


Nana
GeneralRe: OnEnter Event Pin
Agyeman23-Aug-05 2:49
Agyeman23-Aug-05 2:49 
GeneralRe: OnEnter Event Pin
nidhelp23-Aug-05 5:46
nidhelp23-Aug-05 5:46 
Generalaccess autonincrement question Pin
theStorminMormon22-Aug-05 3:58
theStorminMormon22-Aug-05 3:58 
GeneralRe: access autonincrement question Pin
Guffa22-Aug-05 5:38
Guffa22-Aug-05 5:38 
GeneralRe: access autonincrement question Pin
theStorminMormon22-Aug-05 5:43
theStorminMormon22-Aug-05 5:43 
GeneralRe: access autonincrement question Pin
miah alom22-Aug-05 5:57
miah alom22-Aug-05 5:57 
GeneralRe: access autonincrement question Pin
Guffa22-Aug-05 6:38
Guffa22-Aug-05 6:38 
GeneralHorizontal Scroll Bar Pin
zaboboa22-Aug-05 3:47
zaboboa22-Aug-05 3:47 
GeneralRe: Horizontal Scroll Bar Pin
miah alom22-Aug-05 4:58
miah alom22-Aug-05 4:58 
GeneralRe: Horizontal Scroll Bar Pin
zaboboa22-Aug-05 6:17
zaboboa22-Aug-05 6:17 
GeneralRe: Horizontal Scroll Bar Pin
Dan Neely22-Aug-05 7:06
Dan Neely22-Aug-05 7:06 
GeneralRe: Horizontal Scroll Bar Pin
zaboboa22-Aug-05 7:29
zaboboa22-Aug-05 7:29 
GeneralGrading out DataGrid Pin
zaboboa22-Aug-05 3:18
zaboboa22-Aug-05 3:18 
GeneralRe: Grading out DataGrid Pin
miah alom22-Aug-05 4:57
miah alom22-Aug-05 4:57 
Generaltree view question c# Pin
fady_sayegh22-Aug-05 3:13
fady_sayegh22-Aug-05 3:13 
GeneralRe: tree view question c# Pin
miah alom22-Aug-05 5:51
miah alom22-Aug-05 5:51 
GeneralRe: tree view question c# Pin
Robert Rohde22-Aug-05 8:56
Robert Rohde22-Aug-05 8:56 

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.