Regarding Textbox, Treeview and ListBox properties
-
Hi all I am developing instant message application, I need to select a node from treeview and enter the text in the textbox,click Send button to append the text to another ListBox. I have problems in following: 1.When I select a node and enter the text in the textbox,the node is unselected immediately, I wanted to keep node highlighted. 2.When I enter the text and hit enter, I wanted to do same function as Send button, instead the cursor is going to next line on hitting enter key. Please help me , I tried changing all the events/properties but didn't work. Aruna
-
Hi all I am developing instant message application, I need to select a node from treeview and enter the text in the textbox,click Send button to append the text to another ListBox. I have problems in following: 1.When I select a node and enter the text in the textbox,the node is unselected immediately, I wanted to keep node highlighted. 2.When I enter the text and hit enter, I wanted to do same function as Send button, instead the cursor is going to next line on hitting enter key. Please help me , I tried changing all the events/properties but didn't work. Aruna
Hi, Aruna. 1. treeview.HideSelection = false. 2. You can a) set form.AcceptButton = btnSend if your form is a dialog or you can b) handle KeyDown event of the textbox:
private void textbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
// Handle Enter here.
}
} -
Hi, Aruna. 1. treeview.HideSelection = false. 2. You can a) set form.AcceptButton = btnSend if your form is a dialog or you can b) handle KeyDown event of the textbox:
private void textbox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
{
// Handle Enter here.
}
}Thanks a lot Andrew! My problem solved with your help.