Шаг 62 - Формы из VB в C#

Есть такая утилита по адресу:

http://www.laneve.com/tech/vbform2net/default.a

Вот ее страница.

gif/62_1.gif (8664 b)

Она умеет переводить формы VB(FRM) в код на C#. Интерфейс тривиальный. Вот такой:

gif/62_2.gif (2731 b)

На вход файл FRM, на выходе класс C#. Я попробовал. Вот результат - Button,CommboBox и Text были распознаны.

using System;
using System.Drawing;
using System.WinForms;

public class Form1 : Form 
{
	private ComboBox Combo1;
	private Button Command1;
	private TextBox Text1;

	public static int Main(string[] Args) 
	{
		Application.Run(new Form1());
		return 0;
	}

	public Form1() 
	{

		// The following code sets up the form properties.
		this.Text = "Form1";
		this.Height = 3195 + SystemInformation.CaptionHeight;
		this.Width = 4680;
		this.StartPosition = FormStartPosition.WindowsDefaultLocation;
		// The following code sets up the VScroll1 properties.
		// The following code sets up the Combo1 properties.
		Combo1 = new ComboBox();
		Combo1.Height = 315;
		Combo1.TabIndex = 2;
		Combo1.Width = 1095;
		Combo1.Location = new Point(3120, 240);
		// The following two lines demonstrate adding items to a ComboBox object.
		ComboBox.ObjectCollection m_ObjCol_Combo1 = new ComboBox.ObjectCollection(Combo1);
		m_ObjCol_Combo1.Add("Item 1");
		this.Controls.Add(Combo1);
		// The following code sets up the Command1 properties.
		Command1 = new Button();
		Command1.Text = "Command1";
		Command1.Height = 375;
		Command1.TabIndex = 1;
		Command1.Width = 1695;
		Command1.Location = new Point(240, 1080);
		this.Controls.Add(Command1);
		// The following code sets up the Text1 properties.
		Text1 = new TextBox();
		Text1.Height = 285;
		Text1.TabIndex = 0;
		Text1.Width = 1455;
		Text1.Location = new Point(360, 360);
		this.Controls.Add(Text1);
	}
}

Предыдущий Шаг | Следующий Шаг | Оглавление
Автор Каев Артем - 6.10.2001