.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 



Go Back   Dev Articles Community ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 22nd, 2010, 11:33 AM
Black Assassin Black Assassin is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2010
Posts: 1 Black Assassin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 53 sec
Reputation Power: 0
What does it mean in C# ? Cannot implicitly convert type 'string' to 'System.EventArg

I'm programming a calculator in visual C#.net for my high school's homework and I'm badly in need of help.
It's my program without code of numbers:
(btnP = +, btnZ = *, btnS = -, btnT=/)

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 Calculator
{
public partial class Form1 : Form
{
int x, y, c,d;
string e;
public Form1()
{
InitializeComponent();
}
private void btnE_Click(object sender, EventArgs e)
{
if (d==1)
{
y = Convert.ToInt32(textBox1.Text);
c = x + y;
e = Convert.ToString(c);
textBox1.Text += e ;

}
if (d == 2)
{
y = Convert.ToInt32(textBox1.Text);
c = x * y;
e = Convert.ToString(c)
textBox1.Text += e;
}
if (d == 3)
{
y = Convert.ToInt32(textBox1.Text);
c = x - y;
e = Convert.ToString(c);
textBox1.Text += e;
}
if (d == 4)
{
y = Convert.ToInt32(textBox1.Text);
c = x / y;
e = Convert.ToString(c);
textBox1.Text += e;
}
}

private void btnP_Click(object sender, EventArgs e)
{
d = 1;
x = Convert.ToInt32(textBox1.Text);
textBox1.Text = "";

}
private void btnZ_Click(object sender, EventArgs e)
{
d = 2;
x = Convert.ToInt32(textBox1.Text);
textBox1.Text = "";

}

private void btnN_Click(object sender, EventArgs e)
{
d = 3;
x = Convert.ToInt32(textBox1.Text);
textBox1.Text = "";
}

private void btnT_Click(object sender, EventArgs e)
{
d = 4;
x = Convert.ToInt32(textBox1.Text);
textBox1.Text = "";
}
}
}

This program has error in all parts witch is wrote Convert.ToString(c);
It's error:
Cannot implicitly convert type 'string' to 'System.EventArgs'
What's the problem?What should I do?
please help me !

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgramming.NET Development > What does this error mean in C# ? Cannot implicitly convert type 'string' to 'System


Developer Shed Advertisers and Affiliates


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap