Home>
I am currently trying to handle the same event handler for multiple richTextBox controls.
However, you do not know which control caused the event.
However, you do not know which control caused the event.
When right-clicking a rich text box
I am coding to call the context menu and process it.
Because it is called in the order of [Rich Text Box] → [Context Menu] → [Process],
I don't think it can be confirmed with the following code.
private void hoge_contextMenuStrip_Opening (object sender, CancelEventArgs e)
{
Console.WriteLine ((sender as ContextMenuStrip) .Name);
}
-
Answer # 1
-
Answer # 2
Can't you identify by the name of the originating control?
Related articles
- c # - about delivery of source code for systems using third-party components
- c # shape event handler
- c # - rotation control of 3d game objects in unity
- c # - how to call while keeping the control of the existing form
- c # - i want one script to control multiple objects
- i want to control the relay destination for each source ip address with postfix
- c # - i want to place a control inside a control that has already been placed with style
- about c # wpf keydown event
- c # - please tell me the control mascot of cefsharp
- c # - i want to get multiple control names (serial numbers) dynamically
- c # - unity about camera control i want to zoom with mouse scroll
- internal processing when calling c # event handler
- is it possible to add a tap event to the xamarinform grid from the c # code side?
- about remote control in c #
- c # - function not displayed in unity event trigger
- c # - get the text of the textbox dynamically using an event handler
- c # - i want to control a text box on another form, but i can't
- c # - cannot control user control from main form
- c # - i want the dragged graphics to pass over the control
- c # - which is lighter after a certain period of time
Trends
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- python - you may need to restart the kernel to use updated packages error
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- python 3x - typeerror: 'method' object is not subscriptable
- javascript - how to check if an element exists in puppeteer
- xcode - pod install [!] no `podfile 'found in the project directory
- i want to call a child component method from a parent in vuejs
- vuejs - [vuetify] unable to locate target [data-app] i want to unit test to avoid warning
I stopped using the debugger and stopped at the beginning of this event, and then looked into the contents of
sender
and thought it would not be obvious.(I often search this way)
Right-click on any control,
There was a lot in itself.
It seems to be taken with
((ContextMenuStrip) sender) .SourceControl.Name
.