Context Menus with TX Text Control .NET for Windows Forms
A context menu is a very helpful feature to provide end users with information or menu options at a specific text position.
For example, a context menu for adding additional field information could be shown, but only if the user clicks on a field.
This week, we would like to show you how to create a very simple context menu.
When an end user right clicks, a menu will be displayed that offer the actions Cut, Copy and Paste. Only the possible menu entries will be shown.
For example, a Copy menu will be only shown, if a part of the text has been selected by the user.
Private Sub TextControl1_MouseUp(ByVal sender As Object, ByVal_
e As System.Windows.Forms.MouseEventArgs) Handles TextControl1.MouseUp
Dim pos As System.Drawing.Point
If e.Button = MouseButtons.Right Then
MenuItem3.Visible = TextControl1.CanCopy
MenuItem4.Visible = TextControl1.CanPaste
If TextControl1.Selection.Length = 0 Then
MenuItem2.Visible = False
Else
MenuItem2.Visible = True
End If
pos.X = e.X
pos.Y = e.Y
ContextMenu1.Show(TextControl1, pos)
End If
End Sub
We use the TX Text Control MouseUp event to intercept the end user's right mouse click. The Visible property of the different menu entries can be used to hide functionality that is currently not possible. Finally, the context menu will be shown at the X and Y position returned by the MouseUp event.
At least TX Text Control .NET for Windows Forms trial version and Visual Studio .NET is required to test this sample.
New White Paper: Benefits of Web Based Business Applications
We have discussed the benefits of web based applications at length in the last few weeks. This paper summarizes the points that we have raised and presents some more interesting arguments.
The paper shows the benefits of web based intranet and Internet applications. It illustrates how employees and clients can access templates on a corporate network to create business correspondences using TX Text Control based technologies.
TX Text Control News RSS Feeds
Really Simple Syndication (RSS) is a lightweight XML format designed for sharing news items and other web site content. With the ever increasing popularity of RSS, we have decided to make all TX Text Control News and TX Text Control Forum Posts available in this XML format:
https://www.textcontrol.com/en_US/blog/feed/
To stay abreast of what happens on the TX Text Control web site, we suggest that you subscribe to the feeds right away - there are eight to choose from.
To learn more about RSS, please take a look at the following article:
http://www.xml.com/lpt/a/2002/12/18/dive-into-xml.html
Best regards
The Newsletter Team