User Control Eventhandler. How to get my control's components to inherit an Eventhandler.
I have a User Control called
BoxButton
that I want to behave like a Button, I want my PictureBox
and TextBox
to call or invoke BoxButton.Click
.3 Replies
some things I've tried include:
Doesn't work with windows designer code due to syntax, I have to manually type
BoxButton.Click = BoxButton_Click
rather than BoxButton.Click += BoxButton_Click
.
Doesn't work :<
something like this also doesn't work
Error CS0079 "The event 'Control.Click' can only appear on the left hand side of += or -="So you want a button with an icon and, i assume, some text that the user can't type into?
no it's readonly and only for display, label doesn't dock properly so I use a textbox
but yeah pretty much, that's what I want.