Why don't u use threads to run your code. You can use your time to control the different threads in your app.
jowecape
Posts
-
Auto Run Procedures In Windows App -
Writing xml file from datasetI am also having a problem like that. I have have an XML file, and i created a key in the XML Schema. My problem is that if i load my xml file into a dataset and try to "find[primary]", the compiler generates an exception that there is no primary key defined. Can u help?
-
Delegates and Events ProblemSorry for that. this is my first time posting. //From BankAccount.cs using System; using System.Collections.Generic; using System.Text; namespace Delegates_and_Events { public delegate void myEventDelegate(); class BankAccount { public static long Balance; public event myEventDelegate myEvent; public void WithDraw(long amount) { Balance -= amount; myEvent(); } } } //from frmMain.cs private void Form1_Load(object sender, EventArgs e) { BankAccount myAcc = new BankAccount(); BankAccount.Balance = 1000; myAcc.myEvent += new myEventDelegate(OnWithDraw); } public void OnWithDraw() { if (BankAccount.Balance < 0) { MessageBox.Show("Account Overdrawn"); } } I also have a textbox where i am getting the value which i subtract using the following private void btnWithDraw_Click(object sender, EventArgs e) { BankAccount myAcc = new BankAccount(); myAcc.WithDraw(long.Parse(txtAmount.Text)); txtBankBalance.Text = BankAccount.Balance.ToString(); }
-
Delegates and Events ProblemI have created a class called BankAccount. the samle is a floows public delegate void myEventDelegate(); class BankAccount { public static long Balance; public event myEventDelegate myEvent; public void WithDraw(long amount) { Balance -= amount; myEvent(); } } i then wired my event in the frm load to an event handler "OnWithdraw" i also a textbox where by i subtract the money to be withdrawn from the account. The method display an event to the user when the account bal < 0; when i run the program i receiven a NullArgumentException error on the "myEvent" int BankAccount class how do i make my event work?