Hey all,
Im starting to learn C sharpe. For this im using the book: head first C#
It frustrates me that I cannot seem to run any methods that are in classes other than the void main one
When im testing my code i press on start and it only shows the things with the main void which is the entry point of the program.
Why does this not show the messagebox? how do I call it the right way
what am I doing wrong.
Hope some of you can help me out,
already lots of thanks for helping me out on this,
cheers, stephan
Im starting to learn C sharpe. For this im using the book: head first C#
It frustrates me that I cannot seem to run any methods that are in classes other than the void main one
When im testing my code i press on start and it only shows the things with the main void which is the entry point of the program.
Why does this not show the messagebox? how do I call it the right way
what am I doing wrong.
C#:
using System;using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Text;
namespace WindowsFormsApplication1
{
public static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form2());
Application.Run(new Form1());
}
class anotherclass
{
public void methode1()
{
MessageBox.Show("This is a message", "Message");
}
}
}
}
Hope some of you can help me out,
already lots of thanks for helping me out on this,
cheers, stephan