Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pass Object w Index ForNext

Status
Not open for further replies.

Latitude7ds

Programmer
Dec 11, 2007
1
US
I am trying to update 64 bit displays in a For Next Loop. I can pass One Object successfully but can't iterate through a collection in order. Shouldn't GetNextControl do this? It Retrieves the next control forward or back in the tab order of child controls. Is there a Better method to do this?

fn70DiscreteIO statusIO = new fn70DiscreteIO();
for (int i = 0; i <= 64; i++)
{
UpdateIO(statusIO.DiscreteValue, i, GroupBox.GetNextControl(System.Windows.Forms.ProgressBar ctrl, bool forward)); // Update All 32 Bits
}

private void UpdateIO(int data, int bit, System.Windows.Forms.ProgressBar textControl)
{
if ((data & (1 << bit)) != 0)
{
textControl.Value = 1;
}
else
{
textControl.Value = 0;
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top