TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Tayyab Jatoi
NA
135
27.8k
Listbox KeyDown event is not getting Execute
Dec 21 2018 11:55 PM
I have setup that when i press Keydown on itemValueTxt(TextBox Name) it should focus on on my listbox which i name as itemListShow on index 0 and than i create this method itemListShow_KeyDown and i want to go through all items on itemListShow.
BUT
the problem is that after execution of itemValueTxt_KeyDown method the control is not moving at all to this method itemListShow_KeyDown.there is not erroe appearing the control remain only on 0 Index not moving to next items
Please help me to know what i really missing.
private void itemValueTxt_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Down)
{
itemListShow.Focus();
itemListShow.SelectedIndex = 0;
}
}
private void itemListShow_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Down)
{
this.itemListShow.SelectedIndex = this.itemListShow.SelectedIndex;
}
if (e.KeyCode == Keys.Up)
{
this.itemListShow.SelectedIndex = this.itemListShow.SelectedIndex;
}
}
Reply
Answers (
2
)
Assign a value from App.Config to a Attribute of a Property
Using Delegates