Hi, i made a class in a win form app in c#. I want to open the class/degbue it when someone presses button3.
How do i do that?
eoop.org
0
Junior Poster in Training
Recommended Answers
Jump to PostDo this:
public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { MyClass mc = new MyClass(); mc.MyMethod(); } } public class MyClass { public void MyMethod() { System.Windows.Forms.MessageBox.Show("This is a message from my class."); } }
Jump to PostSeeing your code, what do you mean by open a class?
All 7 Replies
Mitja Bonca
557
Nearly a Posting Maven
eoop.org
0
Junior Poster in Training
eoop.org
0
Junior Poster in Training
ddanbe
2,724
Professional Procrastinator
Featured Poster
eoop.org
0
Junior Poster in Training
Momerath
1,327
Nearly a Senior Poster
Featured Poster
divin757
8
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.