So here it is. It succesfully retrieves the text and puts it in my Made richTextbox
// CODE
using System.Windows.Forms;
class Editor: Form
{
public static void Main(string[] args)
{
RichTextBox richedit;
Form form;
richedit = new RichTextBox();
form = new Form();
richedit.Parent = form;
richedit.Dock = DockStyle.Fill;
if (args.Length > 0) {
richedit.LoadFile(args[0], RichTextBoxStreamType.PlainText);
}
Application.Run(form);
}
}
// END
but I want the text to go into my already made richTextBox1 in my windows forms. But it just won't pick my richTextBox in my windows form in the Static Void. heres the code
// CODE
using
System;using
System.Collections.Generic;using
System.Windows.Forms;namespace
brandnwe{
static class Program{
///[
STAThread] static void Main(string[] args){
if (args.Length > 0){
richTextBox1.LoadFile(args[0],
RichTextBoxStreamType.PlainText);}
Application.EnableVisualStyles(); Application.Run(new Form1());}
}
// CODE
Help please.
RealgarPosted Aug 21, 2005, 10:29 AM
///
///
[STAThread]
static void Main(string[] CmdArgs)
{
Application.Run(new Form1(CmdArgs));
}
the constructor is as follow :
public Form1 (string[] CmdArgs)
{
//
// Required for Windows Form Designer support
//
InitializeComponent();
then you do as you please, you can now use CmdArgs[i]
}