### Context Menu

With the B4J Visual Designer, it is simple to add a Context Menu to a View TextView (and others if the Context Menu Proerty is supported).
Example
B4J Layout File Visual Designer
Add a TextView, select Custom Menu from the Control Properties and add like
[
{Text:"Copy", Tag:"mnuCopy", EventName: "mnutf1Copy"},
{Text:"Paste", Tag:"mnuPaste", EventName: "mnutf1Paste"},
{Text:"Clear", Tag:"mnuClear", EventName: "mnutf1Clear"},
"-",
{Text:"Date", Tag:"mnuDate", EventName: "mnutf1Date"},
"-",
{Text:"LowerCase", Tag:"mnuLowerCase", EventName: "mnutf1LowerCase"},
"-",
{Text:"About", Tag:"mnuAbout", EventName: "mnuAbout"}
]
B4J Code Create the Context Menu Items Events
The eventname are defined as previous, like mnutf1Copy, mnutf1Paste etc.
The Subs EventName_Action for the Events:
`Sub mnutf1Copy_Action
fx.Clipboard.SetString(TextField1.Text)
End Sub`
`Sub mnutf1Paste_Action
TextField1.Text = fx.Clipboard.GetString
End Sub`
`Sub mnutf1Clear_Action
TextField1.Text = ""
End Sub`
`Sub mnutf1Date_Action
TextField1.Text = DateTime.Date(DateTime.Now)
End Sub`
`Sub mnutf1LowerCase_Action
TextField1.Text = TextField1.Text.ToLowerCase
End Sub`
`Sub mnuAbout_Action
fx.Msgbox(MainForm, "B4J HowTo TextField Context Menu", "About")
End Sub`

Changed: , Category: TextField, File: T6C262M1935.htm, ID: 1935