473,486 Members | 1,850 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

C# Method Call Help

3 New Member
Im almost certain that I will be unable to provide enoguh information for anyone to help me with this, but I though I would try anyway.
I am writing some code for a bank and have written a method so that if the balance becomes negative, the forecolor of the text is displayed in red.

Expand|Select|Wrap|Line Numbers
  1. void UpdateBalanceDisplay(decimal newValue)
  2.         {
  3.             balanceValueLabel.Text = newValue.ToString();
  4.  
  5.             if (newValue < 0)
  6.             {
  7.                 balanceValueLabel.ForeColor = Color.Red;
  8.             }
  9.  
  10.             else
  11.             {
  12.                 balanceValueLabel.ForeColor = Color.Black;
  13.             }
  14.           }
  15.  
I know I need to call this method everytime I change the balance (so when I withdraw or pay in to an account). However, I am having trouble with the method call.

I have tried just writing
Expand|Select|Wrap|Line Numbers
  1. UpdateBalanceDisplay();
  2.  
But it throws the exception "No overload for method 'UpdateBalanceDisplay' takes '0' arguaments."

I cant figure out how to get this to work, or what needs changing.
May 3 '07 #1
1 1319
Prasannaa
21 New Member
Hi,
There is no such function called (in your code)
UpdateBalanceDisplay(void/no args);
You have declared UpdateBalanceDisplay(decimal) , which takes a decimal.
I think you forgot to pass the value while calling the function.


Regards
Prasannaa
May 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

31
2880
by: Chris S. | last post by:
Is there a purpose for using trailing and leading double underscores for built-in method names? My impression was that underscores are supposed to imply some sort of pseudo-privatization, but would...
5
15331
by: Chris | last post by:
Hi I have a scenario where I've created another AppDomain to dynamically load a DLL(s) into. In this newly loaded DLL I want to call a static method on a class. The problem arise is that I have...
2
2255
by: Stephen | last post by:
Hey everyone. I was wondering if someone could help me with a small problem. I have designed a user control and I would have inserted it on a aspz page (WebForm1). The User control is being used to...
3
1443
by: Apple | last post by:
Hi I am a bit new to python. I was wondering if there is a way to determine whether or not a given string is a member method of a given object: def is_a_method(self, attr_name): 'returns True...
6
1777
by: Teresa | last post by:
1) If I do want to keep an object alive throughout the live of an application, how can I ensure that the GC doesn't clean it up? 2a) How do I determine if an object is a managed or an unmanged...
18
4705
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
3
1887
by: kplkumar | last post by:
I want to call a method passing a parameter. I want to do this call on a seperate thread. For example, public class Foo { public static void FooSend(Message message) { // Start a seperate...
4
1706
by: ddtl | last post by:
Hello everybody. Consider the following code: class A(object): def met(self): print 'A.met' class B(A): def met(self):
6
27755
by: bryanbabula | last post by:
I have a question about overriding i was wondering if anyone could help me with, or even suggesting a better/different way. I have no idea if this can even be done or not. I was wondering if there...
9
5829
by: Steve Richter | last post by:
in a generic class, can I code the class so that I can call a static method of the generic class T? In the ConvertFrom method of the generic TypeConvert class I want to write, I have a call to...
0
7094
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
6839
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5427
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4863
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3066
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.