treeview keypress

H

Hrvoje Voda

I can't get to work treeview keypress event.
I press Enter and nothing happens.

This is a code:

private void treeKeyPress(object sender, KeyPressEventArgs e)

{ if (e.KeyChar == (char)13)

{

ConnString = "workstation id=HRVOJE;packet size=4096;integrated
security=SSPI;data +

source=HRVOJE;persist security info=False;initial catalog=DVD";

bDb = new Db(ConnString);

grid.Refresh();

string Film;

Film = (treeView.SelectedNode.Text);

grid.Table = bDb.datasetDVD.Tables [Film];

}

}



Hrcko
 
H

Hrvoje Voda

I forget to put this:

tree.KeyPress += new KeyPressEventHandler(this.treeKeyPress);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top