private void UpdateStepProperties(BreadCrumbStep step) { blinkCurrentTimer.Stop(); if (step.Completed) { step.BackColor = CompletedStepBackColor; step.ForeColor = StepTextColor; } else { step.BackColor = UncompletedStepBackColor; } if (step.Current) { step.Font = new Font(Font, FontStyle.Bold); } else { step.Font = new Font(Font, FontStyle.Regular); // the blink timer was leaving the forecolor as the background color that // is used to "hide" the text for the off portion of the blink step.ForeColor = StepTextColor; } blinkCurrentTimer.Start(); }
public void SetCurrentStep(int index) { BreadCrumbStep newCurrentStep = null; if (steps.Count > index) { newCurrentStep = steps[index]; foreach (BreadCrumbStep step in steps) { if (step == newCurrentStep) { step.Current = true; if (BlinkCurrentStep) { blinkCurrentTimer.Start(); } } else { step.Current = false; } UpdateStepProperties(step); } } }
protected int AddStep(string text) { int right = steps.Count * (StepBoxWidth + StepBoxHorizontalMargin); if (steps.Count > 0) { // create arrow PictureBox arrowPictureBox = new PictureBox(); arrowPictureBox.SizeMode = PictureBoxSizeMode.CenterImage; arrowPictureBox.Size = new Size(StepBoxHorizontalMargin, ClientSize.Height); arrowPictureBox.Location = new Point(right - StepBoxHorizontalMargin, 0); if (ArrowLinks) { arrowPictureBox.Image = Libraries.ControlLib.Resource.arrowLink; } else { arrowPictureBox.Image = Libraries.ControlLib.Resource.barLink; } arrowPictureBox.Visible = ShowLinks; Controls.Add(arrowPictureBox); } // create the step BreadCrumbStep newStep = new BreadCrumbStep(text); newStep.Size = new Size(StepBoxWidth, ClientSize.Height - 2 * StepBoxVerticalMargin); newStep.Location = new Point(right, StepBoxVerticalMargin); Controls.Add(newStep); steps.Add(newStep); UpdateStepProperties(newStep); return(steps.IndexOf(newStep)); }
private BreadCrumbStep GetStepByText(string text) { BreadCrumbStep ret = null; foreach (var step in steps) { if (step.Text.CompareTo(text) == 0) { ret = step; break; } } return(ret); }