Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

HOW TO: populate indvidual controls with data from array  Part2

Posted on 2006-05-12
2
Medium Priority
?
203 Views
Last Modified: 2010-04-16
Now the problem I am having is that the buttons inside the Groupbox are user defind control (buttons) that inherits from a button class and that has serveral properties I need to assign inside the for loop.  Intellisense is not showing me the properties of my user defined control only the standard properties of a control type??  See the following code:

private void LoadPOSTransationTypes()
{
    try
    {
        POSTransactionTypeListItemsInfo[] posTT = ListItems.GetPOSTransactionTypeListItems();
        if (posTT.Length > 0)
        {
            foreach (Control control in this.ugbTransactionTypes.Controls)
            {
                if (control is uccTouchScreenToggleButton)
                {
                    int index = int.Parse(uccTSTB.Name.Substring(18));
                    if (index < posTT.Length)
                    {
                        control.Enabled = true;
                        control.Text = posTT[index].postt_POSButtonDisplayText;
                    }
                    else
                    {
                        control.Enabled = false;
                    }
                }
            }
        }
        else
        {
        }
    }
    catch (Exception ex)
    {
        bool rethrow = ExceptionPolicy.HandleException(ex, "Global Policy");
        if (rethrow)
        {
            throw;
        }
    }
    finally
    {
     }

}  // END: private void LoadPOSTransationTypes()
0
Comment
Question by:wenyonk
2 Comments
 
LVL 25

Accepted Solution

by:
dstanley9 earned 1200 total points
ID: 16670192
try

                if (control is uccTouchScreenToggleButton)
                {
                    uccTouchScreenToggleButton button = control as uccTouchScreenToggleButton;
                    // Intellisense will now be available on the button object

                    int index = int.Parse(uccTSTB.Name.Substring(18));
                    if (index < posTT.Length)
                    {
                        button.Enabled = true;
                        button.Text = posTT[index].postt_POSButtonDisplayText;
                    }
                    else
                    {
                        button.Enabled = false;
                    }
                }
0
 

Author Comment

by:wenyonk
ID: 16670946
Thank you!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question