Note that there are some explanatory texts on larger screens.

plurals
  1. POThe method is not being called. I think maybe something with a parameter?
    primarykey
    data
    text
    <p><code>WindowsFormsApplication2.Form1.BankAccount</code> does not contain a definition for <code>withBox</code> and no extension method <code>withBox</code> accepting a first argument of type <code>WindowsFormsApplication2.Form1.BankAccount</code> could be found (are you missing a using directive or an assembly reference?)</p> <p>This is one the <code>num1 = Convert.ToDecimal(this.withBox.Text);</code> line of code.</p> <p>Earlier I asked a question about this, and did much more research into my problems. I believed I did everything correct this time. But still getting errors. I am unsure of what I am doing wrong now.</p> <pre><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 WindowsFormsApplication2 { public partial class Form1 : Form { BankAccount a = new BankAccount(); public Form1() { InitializeComponent(); decimal iBa = 300.00m; this.aMtBox.Text = iBa.ToString(); } private void dep_Click(object sender, EventArgs e) { try { decimal num1 = 0.00m; decimal iBa = 300.00m; num1 = Convert.ToDecimal(this.depBox.Text); decimal total = num1 + iBa; this.aMtBox.Text = total.ToString(); } catch { MessageBox.Show("ERROR", "Oops, this isn't good!", MessageBoxButtons.OK, MessageBoxIcon.Error); } } public void withdrawl_Click(object sender, EventArgs e) { this.aMtBox.Text = a.Balance.ToString(); } public class BankAccount { decimal balance; decimal iBa; decimal num1; public decimal Balance { get {return balance;} } public decimal IBa { get {return iBa;} } public decimal Num1 { get {return num1;} } public BankAccount() { iBa = 300.00m; num1 = Convert.ToDecimal(this.withBox.Text); balance = iBa - num1; } } } </code></pre> <p>}</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload