So I been stuck with this problem for quite a few days. Since I used VB.net as my first language C# is quite difficult for me.
In VB.net when you needed to refer to a different control on a different forum you would write something like Form1.Mainmenu etc
In C# you write, I don't know!:'(
So here is the problem. I have made a text-editor with one form (called Editor). Now I want to make the second form which will be the options form. (called Options)
From the Options form I want to be able to access the controls on Editor and change their backcolor text, and other things etc. I also want to be able use code from Editor.
Now here is the code I want. I made a method called Void InstalledFonts()
void InstalledFonts()
{
InstalledFontCollection fonts = new InstalledFontCollection();
for (int i = 0; i < fonts.Families.Length; i++)
{
fontSelection.Items.Add(fonts.Families[i].Name);
}
}
(OK so for those who don't know what this code is doing it basically get a list of system fonts and putting them in to a comboBox when the program loads. )
I want to use this same code in the Options form as well. How can I refer to it? I don't want to retype it, I heard cut and paste is the sworn enemy of a programmer :icon_cheesygrin:
I hope someone understands and can help me out here.