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

Promblem With RadTextBox - Context Menu

3 Answers 188 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Andrés David Santacoloma Isaza
Top achievements
Rank 1
Andrés David Santacoloma Isaza asked on 01 Jun 2010, 12:09 AM
Hello:

I have a problem with the following code:

Private Sub

 

 

RadForm1_Load(sender As Object, e As EventArgs)

 

tbGiftType.TextBoxElement.TextBoxItem.HostedControl.ContextMenuStrip =

 

New

 

ContextMenuStrip()

tbGiftType.TextBoxElement.MouseDown +=

 

New MouseEventHandler

 

(TextBoxElement_MouseDown)

LoadWrappingContextMenu()

End Sub

It's for quit the default context menu of radtextbox and put a context menu with my properties.
Wath's the code for it?

Thanks

David.

3 Answers, 1 is accepted

Sort by
0
Martin Vasilev
Telerik team
answered on 03 Jun 2010, 04:35 PM
Hello Andrés David Santacoloma Isaza,

You can replace the default context menu as it is shown below:
Private Sub Form1_Load(sender As Object, e As EventArgs)
    Dim menu As New ContextMenuStrip()
    menu.Items.Add("Item1")
    menu.Items.Add("Item2")
  
    Me.radTextBox2.TextBoxElement.TextBoxItem.HostedControl.ContextMenuStrip = menu
End Sub

Let me know if you have any additional questions.

Kind regards,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Andrés David Santacoloma Isaza
Top achievements
Rank 1
answered on 12 Jun 2010, 05:15 PM

Thanks, but my new contextMenu is a RadContextMenu and when i write:

Me.radTextBox2.TextBoxElement.TextBoxItem.HostedControl.ContextMenuStrip = MiRadMenu

it write the following error:

Telerik.WinControls.UI.RadContextMenu can't convert in System.Windows.Forms.ContextMenuStrip

 

0
Martin Vasilev
Telerik team
answered on 17 Jun 2010, 03:57 PM
Hello David,

Thank you for getting back to me. 

Please refer to this help article which concerns the process of assigning a RadContextMenu to Telerik or non-Telerik controls. Do not hesitate to contact me again if you have any additional questions.

Greetings,
Martin Vasilev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
ContextMenu
Asked by
Andrés David Santacoloma Isaza
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Andrés David Santacoloma Isaza
Top achievements
Rank 1
Share this question
or