Hello again Jerome,
Ok, i've been having a look at this for you, and it's ended up to be quite simple. In the code below, I have a RadRibbonBar and a RadGridView on the form. I've added one tab to the RadRibbonBar, and one group to the tab. In the group, I have then added a RadTextBoxElement during Form Load and wired up the KeyDown events of each of the items on the form.
The magic line to get the cursor to flash in the textbox is:
Here is the whole thing..
using
System;
using
System.Windows.Forms;
using
Telerik.WinControls.UI;
namespace
RadControlsWinFormsApp1
{
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
Form1_Load(
object
sender, EventArgs e)
{
RadTextBoxElement textboxElment =
new
RadTextBoxElement();
this
.radRibbonBarGroup1.Items.Add(textboxElment);
this
.radRibbonBar1.KeyDown +=
new
System.Windows.Forms.KeyEventHandler(
this
.SearchKeyDown);
this
.KeyDown +=
new
System.Windows.Forms.KeyEventHandler(
this
.SearchKeyDown);
this
.radGridView1.KeyDown +=
new
System.Windows.Forms.KeyEventHandler(
this
.SearchKeyDown);
}
private
void
SearchKeyDown(
object
sender, KeyEventArgs e)
{
if
(e.KeyCode == Keys.F3)
MessageBox.Show(
"Here"
);
else
if
(e.KeyCode == Keys.F && e.Modifiers == Keys.Control)
{
RadTextBoxElement txt = (RadTextBoxElement)
this
.radRibbonBarGroup1.Items[0];
txt.TextBoxItem.Text =
""
;
// Focus on the hosted control, not the textbox item
txt.TextBoxItem.HostedControl.Focus();
}
}
}
}
Hope this helps, but let me know if you need more information. Please remember to mark as answer if this has provided the answer for you.
Thanks
Richard