C
C#3y ago
Pillow

✅ Button doesn't trigger function for it

According to https://learn.microsoft.com/en-us/visualstudio/ide/create-csharp-winform-visual-studio?view=vs-2022 I think this should work, but it doesn't. Here's the code:
private void btnClick1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello, world.");
}
private void btnClick1_Click(object sender, EventArgs e)
{
MessageBox.Show("Hello, world.");
}
and the properties for the button (default except for the name and text which are changed) (btw, nothing happens when I click it if that wasn't clear)
4 Replies
phaseshift
phaseshift3y ago
Did you write all of the event handler yourself, v or did you double click in the event menu and it was generated for you? Click on the lightning bolt from your image and show any existing handlers
Pillow
PillowOP3y ago
aaaah i assume i do this (it was blank before)
Pillow
PillowOP3y ago
works now, tysm
phaseshift
phaseshift3y ago
👍🏻 Please close with /close

Did you find this page helpful?