hi all friends

I wanna check if presses keys shift and tab then focus will go to the textbox that i want.

Recommended Answers

All 3 Replies

try this code:

public Form1()
        {
            InitializeComponent();
            this.KeyPreview = true;
            this.KeyUp += new KeyEventHandler(Form1_KeyUp);
        }

        private void Form1_KeyUp(object sender, KeyEventArgs e)
        {
            if(e.KeyCode == Keys.Tab && e.Shift)
            {
              
            }
        }

OR just use tab indexes. It is a property of all editable controls in .Net . Remember to set TabStop = true. Also, remember that TAB will increment the currently selected tab index, and Shift-Tab will decrement it. No use in writing custom event code for something that is already done for you.

there are leave items....u have to write code in leave item.......if(textbox1.text="")
{
textbox1.text="";
}
else
{
textbox2.text=something;
textbox3.text=something;
}
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.