This is a migrated thread and some comments may be shown as answers.

Problem with Alt-Key

4 Answers 113 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Stefan
Top achievements
Rank 1
Stefan asked on 08 Nov 2008, 01:01 PM

Hi,

I'm creating an WebEditor with the Ribbonbar in Vb.net.

My problem is, that always if I press Alt, the Ribbonbar

gots the focus. That's a big problem, because

the user can't write chars like "{" or "}", wich are

very important for writing Website ( for Example in PHP ).

Can I deactivate it, or is there any workaround?

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 12 Nov 2008, 10:22 AM
Hi Stefan,

The behavior observed is because of the RadRibbonBar Key Tips feature. In order to turn it off, please set the EnableKeyMap to false in the form's constructor:
public Form1()  
{  
    InitializeComponent();  
 
    this.radRibbonBar1.EnableKeyMap = false;  

If you have additional questions, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stefan
Top achievements
Rank 1
answered on 12 Nov 2008, 04:36 PM

There is no "EnableKeyMap" property.

Maybe I've got an old Version, I got this from 

Microsoft, the Version is Q4 2006.

Can I get an Update, if there is a newer version?

0
Accepted
Nikolay
Telerik team
answered on 13 Nov 2008, 01:48 PM
Hello Stefan,

There is a newer version of RadRibbonBar. However, it is a part of our WinForms suite and we cannot isolate it. Therefore, I cannot provide you with the updated version.

Actually, this there is a property for enabling/disabling the key tips in your version as well, but you are not able to access it. Therefore, I made a workaround using the reflection approach which sets the value of the particular property:
public Form1()     
{     
    InitializeComponent();     
    
    SetProperty(this.radRibbonBar1, "EnableKeyTips"false);     
}     
    
public void SetProperty(object obj, string propertyName, object val)     
{     
    Type t = typeof(RadControl);     
    BindingFlags flags = BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public;     
    System.Reflection.PropertyInfo pi = t.GetProperty(propertyName, flags);     
    val = Convert.ChangeType(val, pi.PropertyType);     
    pi.SetValue(obj, val, null);     
}     
 

I hope this helps. If you have additional questions, feel free to contact me.

Kind regards,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Stefan
Top achievements
Rank 1
answered on 13 Nov 2008, 02:21 PM

thx, it works.

For all, who look for the soloution in vb.net:

SetProperty(Me.RadRibbonBar1, "EnableKeyTips", False)

 Public Sub SetProperty(ByVal obj As Object, ByVal propertyName As String, ByVal val As Object)
Dim t As System.Type = GetType(Telerik.WinControls.UI.RadRibbonBar)
Dim flags As System.Reflection.BindingFlags = System.Reflection.BindingFlags.Instance Or System.Reflection.BindingFlags.NonPublic Or System.Reflection.BindingFlags.[Public]
Dim pi As System.Reflection.PropertyInfo = t.GetProperty(propertyName, flags)
val = Convert.ChangeType(val, pi.PropertyType)
pi.SetValue(obj, val, Nothing)
End Sub

Tags
RibbonBar
Asked by
Stefan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Stefan
Top achievements
Rank 1
Share this question
or