- Joined
- Apr 10, 2011
- Sythe Gold
- 0
- Messages
- 1,013
Hey guys,
I had to study for my exam of c#, but I got bored, so for the fun of it I made a little charm counter.
Everytime you click on one of the buttons it will add a charm to the counter.
Total kills button will tell you how many kills you have made, you will need to click everytime after a kill.
If you close the file the programme will automaticly write away the info about your charms / kills count!
(this is to an .txt file)
pics:
It might not look like much, but for a beginning programmer its not too bad?
Leave me some comments with your thoughts guys!
NOTE: if you download this. Its a ZIP, unzip it and keep the .exe file within a folder. Your .txt file will be added in the same folder when you exit the application.
Download link:
http://www.2shared.com/file/b_S0xiLf/Yenthe666s_Charm_Counter.html
TO MODS: Let me know if this is not allowed, if I should post more pics, more proof, or anything.
I hope I did it all well!
Source code:
I had to study for my exam of c#, but I got bored, so for the fun of it I made a little charm counter.
Everytime you click on one of the buttons it will add a charm to the counter.
Total kills button will tell you how many kills you have made, you will need to click everytime after a kill.
If you close the file the programme will automaticly write away the info about your charms / kills count!
(this is to an .txt file)
pics:
It might not look like much, but for a beginning programmer its not too bad?
Leave me some comments with your thoughts guys!
NOTE: if you download this. Its a ZIP, unzip it and keep the .exe file within a folder. Your .txt file will be added in the same folder when you exit the application.
Download link:
http://www.2shared.com/file/b_S0xiLf/Yenthe666s_Charm_Counter.html
TO MODS: Let me know if this is not allowed, if I should post more pics, more proof, or anything.
I hope I did it all well!
Source 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;
using System.IO;
namespace Charm_counter
{
public partial class Form1 : Form
{
private int _goldCharms = 0;
private int _greenCharms = 0;
private int _crimsonCharms = 0;
private int _blueCharms = 0;
private int _totalKills = 0;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.ForeColor = Color.Red;
this.Font = new Font("verdana", 12, FontStyle.Bold);
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
this.ControlBox = false;
buttonExit.Text = "Close App";
labelTotalKills.ForeColor = Color.Red;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.BackColor = Color.FromArgb(210, 210,210);
this.BackgroundImage = Properties.Resources.Background;
this.Icon = Properties.Resources.favicon;
// alles transparant
label1.BackColor = Color.Transparent;
labelTotalKills.BackColor = Color.Transparent;
pictureBoxBlueCharm.BackColor = Color.Transparent;
pictureBoxCrimsonCharm.BackColor = Color.Transparent;
pictureBoxGoldCharm.BackColor = Color.Transparent;
pictureBoxGreenCharm.BackColor = Color.Transparent;
labelGold.BackColor = Color.Transparent;
labelGreen.BackColor = Color.Transparent;
labelCrimsonCharms.BackColor = Color.Transparent;
labelBlueCharms.BackColor = Color.Transparent;
// forecolor van labels
labelGold.ForeColor = Color.White;
labelCrimsonCharms.ForeColor = Color.White;
labelGreen.ForeColor = Color.White;
labelBlueCharms.ForeColor = Color.White;
buttonAddBlue.ForeColor = Color.White;
buttonAddCrimson.ForeColor = Color.White;
buttonAddGold.ForeColor = Color.White;
buttonAddGreen.ForeColor = Color.White;
// gold charms
pictureBoxGoldCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGoldCharm.Image = Properties.Resources.gold;
pictureBoxGoldCharm.Left = 5;
buttonAddGold.Text = "Gold charm";
buttonAddGold.BackColor = Color.Gold;
buttonAddGold.Left = 105;
buttonAddGold.Height = 30;
buttonAddGold.Width = 90;
// green charms
pictureBoxGreenCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxGreenCharm.Image = Properties.Resources.green;
buttonAddGreen.Left = 310;
buttonAddGreen.Text = "Green charm";
buttonAddGreen.BackColor = Color.Green;
buttonAddGreen.Height = 30;
buttonAddGreen.Width = 90;
// crimson charms
pictureBoxCrimsonCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxCrimsonCharm.Image = Properties.Resources.crimson;
pictureBoxCrimsonCharm.Left = -5;
buttonAddCrimson.Text = "Crimson charm";
buttonAddCrimson.BackColor = Color.Red;
buttonAddCrimson.Left = 105;
buttonAddCrimson.Height = 30;
buttonAddCrimson.Width = 90;
// blue charms
pictureBoxBlueCharm.SizeMode = PictureBoxSizeMode.Zoom;
pictureBoxBlueCharm.Image = Properties.Resources.blue;
buttonAddBlue.Left = 310;
buttonAddBlue.Text = "Blue";
buttonAddBlue.BackColor = Color.Blue;
buttonAddBlue.Height = 30;
buttonAddBlue.Width = 90;
}
private void buttonAddGold_Click(object sender, EventArgs e)
{
_goldCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}
private void buttonAddCrimson_Click(object sender, EventArgs e)
{
_crimsonCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}
private void buttonAddGreen_Click(object sender, EventArgs e)
{
_greenCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}
private void buttonAddBlue_Click(object sender, EventArgs e)
{
_blueCharms++;
labelGold.Text = "Total Gold Charms: " + _goldCharms;
labelGreen.Text = "Total Green Charms: " + _greenCharms;
labelCrimsonCharms.Text = "Total Crimson Charms: " + _crimsonCharms;
labelBlueCharms.Text = "Total Blue Charms: " + _blueCharms;
}
private void buttonExit_Click(object sender, EventArgs e)
{
DialogResult antwoord;
antwoord = MessageBox.Show("Are you sure you want to close the programme?", "Close?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (antwoord == System.Windows.Forms.DialogResult.Yes)
{
StreamWriter streamSchrijf = new StreamWriter("charmcounter.txt", true);
streamSchrijf.WriteLine(labelGold.Text + Environment.NewLine + labelGreen.Text + Environment.NewLine + labelCrimsonCharms.Text + Environment.NewLine + labelBlueCharms.Text + Environment.NewLine + labelTotalKills.Text + Environment.NewLine + DateTime.Now.ToLongDateString() + " - " + DateTime.Now.Hour + ":" + DateTime.Now.Minute + ":" + DateTime.Now.Second + Environment.NewLine);
streamSchrijf.Close();
streamSchrijf.Dispose();
Application.Exit();
}
}
private void buttonTotalKills_Click(object sender, EventArgs e)
{
_totalKills++;
labelTotalKills.Text = "TOTAL KILLS: " + _totalKills;
this.Text = "Charm drop rates - Total monsters killed: " + _totalKills;
}
}
}






