Let's say i have this code:
Form1.cs:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ChatzyClient
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
}
}
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Windows.Forms;
namespace ChatzyClient
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
ClientEngine myClient = new ClientEngine();
Thread engineThread = new Thread(new ThreadStart(myClient.StartEngine));
// start de engineThread
engineThread.Start();
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
MainForm mainform = new MainForm();
Application.Run(mainform);
}
}
}
ClientEngine.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ChatzyClient
{
class ClientEngine
{
public void StartEngine()
{
while (true)
{
Console.WriteLine("test");
}
}
}
}
So, you don't see it, but i have a few TextBox's like txtMonitor and txtTextInput. In form1.cs i can access the methods of those objects easily of course (like the method txtTextInput.Text) but now my question: how can i access them in the class ClientEngine?

New Topic/Question
Reply




MultiQuote






|