Hai, this is a guide on how to make a control panel for your server, repack, whatever. :wave: For people wondering this is just a basic one coded in C#. Nothing that fancy.
I. Programs needed.
II. Installing.
III. Making it.
IV. Customizing it.
V. Ending
Before you do this make shortcuts of logon,ascent,and mysql!
I. Programs needed.
II. Installing
1). Well download the file.
2). Run it and let it extract the files and copy the resources.
3). Keep clicking ok and all until it asks you if you want to install additional products. Uncheck all of them. (Note: I already have mine installed and its a burden to reinstall it, sorry)
4). Ok then it should be installing the net framework, the program, and all that.
5). Let it finish and then your good to go.
III. Making it
Ok well now you all are probaly wondering why do I need this program? Whats it for? This is what you make it in, it helps you with the codes, lets you do so many things with your program, and last of all compile it.
1). Open Microsoft Visual it should be located in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE
2). Go to file > New project or press Ctrl+Shift+N.
3). It brings up a menu. It looks like this http://img301.imageshack.us/img301/7353/examplecy0.png Ms paint ftw.
4). Ok now it is finally time to make it!
5). It should show a whole different window, with a toolbox to the left, a form beside it, and a solution explorer to the right.
6). Well lets say I don't like how big it is now, take your mouse and bring it over the form, you should be little boxes where you can make it smaller or bigger.
7). Go over to the toolbox and bring a "button" over.
8.) Place it anywhere you want on the form.
9). Double click it now, you should see
Code:
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 My_control_panel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
}
}
}
For reasons im not going to explain the code but we need to focus on Button1_click.
10). Ok now make it like this
Code:
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/server/mysql_start.lnk");
}
11). Now we are going to be renaming it. Refer to this picture. http://img90.imageshack.us/img90/3916/textrk2.png
12). Now repeat the steps until you have working buttons for logon and ascent.
IV Customizing it.
This will show you how to make it more appealing. This part is all optional and you can follow then in any order really. The ones with a * means that they are connected.
1). Ok im going to add some text, go to the toolbox and drag a "label" onto the form. place it anywhere you like and then change the text to whatever you like. I did made my clain.
*2). Lets add a menustrip. Go over to the toolbox and drag a "menustrip" over. Then click it one time and add the htings you want I did Ascent >Configs > Logon,realms, ascent. then Server > Configs > htdocs,apache, account page.
*3). This is for the menustrip. For say now I'll go to ascent > configs > realms (Double click realms). then you would see
Code:
private void realmsToolStripMenuItem_Click(object sender, EventArgs e)
{
}
make it like this.
Code:
private void realmsToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-realms.conf");
}
*4). Then just keep on going doing it like that.
5). Well now i want to change the name of the program itself. Click on the main form (the body) and find the text colum. Change it to what you want. I did Control panel.
6). Hrmmm im not liking the icon of the program, you can make your own with the program iconcool editor listed above (Its optional again). Once you make your icon save it, and click on the main form again. This time go to the column "icon" and select the icon you made. BUT the program itself does not have this icon. Use step 7.
*7). Go to the solution explorer, double click on properties. Look down and theres a section for icons. See the "Icon:" well click the ... and select your own icon. Now go back to the design form.
V. Ending (lol)
This shall finish it up.
1). Im done with my basic launcher, but now we have to compile it. Go to the solution explorer and right click it > Build. It should build now and be saved to a project file somewhere on your computer.
If more people are intrested in making one, I shall add more pictures, make it clearer, and add more features.
My finally result is this. All credits to me clain by the way.
Heres the whole code of form1.cs
Code:
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 My_control_panel
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/server/mysql_start.lnk"); //mysql
}
private void button2_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-logonserver.lnk"); //logon
}
private void button3_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-world.lnk"); //ascent
}
private void realmsToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-realms.conf"); //Realms.conf
}
private void logonToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-logonserver.conf"); //logon.conf
}
private void ascentToolStripMenuItem1_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Ascent/ascent-world.conf"); //Ascent.conf
}
private void apacheToolStripMenuItem_Click(object sender, EventArgs e)
{
System.Diagnostics.Process.Start("Directory to the link, I.e C:/Repack/Server/apache/extra/httpd.conf"); //Httpd.conf //note i left out the other menu items for this is an example.
}
}
}