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

Problem with highlighting text and right click menu

1 Answer 83 Views
TextBox
This is a migrated thread and some comments may be shown as answers.
NA
Top achievements
Rank 1
NA asked on 28 Mar 2008, 05:04 PM
I am having trouble customizing/theming one particular area of this control, the color in which the input text is highlighted. It seems to default to whatever the OS is using, which completely clashes with the custom theme that can be loaded for this control. I think the same problem exists in the ComboBox and regular text box.

Can someone point me to where this can be customized? If not customizeable, I would suggest adding it as its very incongruent with the theming ability.

The same goes for the menu. The default right click menu on these controls seems to be the bevelled default menu style for whatever the OS is using (XP and it's theme, or what have you).

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 01 Apr 2008, 01:55 PM
Hi NA,

The color of the selected text and the corresponding background area is governed by the Operating System and this behavior cannot be customized.

As to the context menus, you can use RadDropDownMenu instead of the default ContextMenu. The right approach to do this is by code. In the targeted control's MouseDown event handler, you should create and show the context menu.

Please refer to the snippet below:

private void radButton1_MouseDown(object sender, MouseEventArgs e)  
{  
    if (e.Button == MouseButtons.Right)  
    {  
        RadDropDownMenu contextMenu = new RadDropDownMenu();  
 
        contextMenu.BeginInit();  
 
        RadMenuItem item = new RadMenuItem("First item");  
        item.Click += new EventHandler(firstItem_Click);  
        contextMenu.Items.Add(item);  
 
        RadMenuItem item2 = new RadMenuItem("Second item");  
        item2.Click += new EventHandler(secondItem_Click);  
        contextMenu.Items.Add(item2);  
 
        contextMenu.EndInit();  
 
        contextMenu.Show(Control.MousePosition);  
    }              

I hope this helps. If you have additional questions, do not hesitate to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
TextBox
Asked by
NA
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or