Embedding arbitrary item in RadMenuStrip
|
Article relates to
|
r.a.d menustrip for WinForms
|
|
Created by
|
Tsvetan Raikov, Telerik
|
|
Last modified
|
February 9, 2007
|
|
Last modified by
|
Tsvetan Raikov, Telerik
|
HOW-TO
Embed arbitrary item in RadMenuStrip
SOLUTION
In r.a.d
menustrip you can embed any custom
RadElement. To do this follow the steps below:
- Create instances of RadMenuContentItem and your custom element (in this case RadTextBoxElement):
| RadMenuContentItem contentItem = new RadMenuContentItem(); |
| RadTextBoxElement textBoxElement = new RadTextBoxElement(); |
- Set the AutoSizeMode property to WrapAroundChildren. The MaxSize property must be set to some restrictive value:
| textBoxElement.AutoSizeMode = |
| Telerik.WinControls.RadAutoSizeMode.WrapAroundChildren; |
| textBoxElement.MaxSize = new Size(150, 19); |
- Assign the ContentElement property with your custom element and add the content item to menu items list:
| contentItem.ContentElement = textBoxElement; |
| RadMenuItem1.Items.Add(contentItem); |
Comments
If you'd like to comment on this KB
article, please, send us a
Support Ticket.
Thank you!
Please
Sign In
to rate this article.