Closed Thread
Results 1 to 2 of 2

Thread: Passing on component name

  1. #1
    Deathblake is offline Newbie
    Join Date
    Feb 2010
    Posts
    3
    Rep Power
    0

    Passing on component name

    Hi

    I am relatively new to programming, but have spent time looking at the basics.

    Right now I am adding a feature to an open-sourced program, and need help in passing on a checkbox name.

    What I have tried is to extract the name from the object and pass on the string, however I am having trouble getting the string accepted as code:

    Code:
            private void tick_Up_CheckedChanged(object sender, EventArgs e)
            {
                string senderStr = (sender as CheckBox).Text;
                if (tick_Up.Checked)
                {
                    PresAction(combo_Up.Text, senderStr);
                }
                else
                {
                    PresActionUp(combo_Up.Text, senderStr);
                }
            }
    I'm guessing that there is an easier way, like passing on the object.

    Help please

    Thanks in advance

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    QuackWare is offline Learning Programmer
    Join Date
    Jan 2010
    Posts
    95
    Rep Power
    8

    Re: Passing on component name

    You should be able to access the text of the checkbox directly through either it's name or text field (Can't remember which exactly).

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Problem with my own component
    By jaiii in forum C and C++
    Replies: 0
    Last Post: 05-21-2010, 01:03 AM
  2. Topcoder component
    By selvaa89 in forum Java Help
    Replies: 3
    Last Post: 02-07-2010, 09:54 AM
  3. How to tell what number a component is....
    By 2710 in forum Pascal and Delphi
    Replies: 1
    Last Post: 10-16-2009, 01:43 PM
  4. [Resolved]Module or Component?
    By stingray in forum easyContact
    Replies: 2
    Last Post: 11-19-2007, 12:39 PM
  5. How to make a component
    By ikkeugh in forum Visual Basic Programming
    Replies: 2
    Last Post: 10-04-2007, 08:26 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts