Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8701515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:25:02+00:00 2026-06-13T02:25:02+00:00

Can anybody help me with this?: I’m trying call a method from a my

  • 0

Can anybody help me with this?:
I’m trying call a method from a my class “numbers” to show that if the entered number is over 50, on button click a message box shows displaying “high” but if it’s below 50 it displays “low”.
I can’t figure out what i’m doing wrong here.
This is the code from my class:

    private int number; 
    private string getNumber(int num)
    {

        number = num;
        return number.ToString();
    }

        public int numProperty
    {
        get { return number; }
        set { number = value; }
    }

     public void isHighorlow()
        {    
            if (number >=50)
            {

            }
            else
            {
                return;
            }

        }

Note: the int “number” is property that gets it’s value from a text box too.
& here is the code from my form:

     numbers info = new numbers();
     private void Btn_Click(object sender, EventArgs e)
    { 
      info.numProperty = Convert.ToInt32(numberBOX.Text);
      info.isHighorlow = Messagebox.Show = ("High");
    }

I know that I’ve not added the “low” bit yet because i’m still trying to see how this works. Sorry if it seems confusing as i’m still learning c#.
I get the error message: cannot assign isHighorlow because it’s part of a method group.
And I also realise it’s much easier if I just do an if statement on the textbox, but I’m practising Classes and Methods so I’m trying to do it this way.
thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T02:25:03+00:00Added an answer on June 13, 2026 at 2:25 am

    IsHighOrLow should be as follows

        public bool isHighorlow()
        {    
            if (number >=50)
            {
    
               return true;
            }
            else
            {
                return false;
            }
    
        }
    

    And in button click

    if (info.isHighorlow){
    //say high
    } else
    {
    // say low
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody help me in this? I want to get an screenshot from an
Hi can anybody help me on this issue, like i was trying to create
Can anybody help with this code I just don't know where I am going
Can anybody help me with this simple code?? #include <iostream> using namespace std; void
can anybody help me solve this : i got $filename= index 198.php; i use
Can anybody help me get this date format like Fri, 01 Oct 22:26:23 +0200
Can anybody help me to solve this problem. I am working on iphone development.
can anybody help me understand how Honda achieved this effect: http://testdays.hondamoto.ch/ I mean the
Can anybody please help me with this as I have no idea why public
Console dogs me. Can anybody help? The sad story starts like this. My OS

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.