0

I made a custom FindControl function to find a control within all childs of one control I pass in parameter. But I don't manage to have a hand over the button used to create a user ,in a CreateUserWizard Control.

I kept the default style, do anyone knows the name (ID) of this button?

I saw buttons like "ContinueButtonButton", "FinishButton", but they don't seem to be the one I am searching for, because I then have this line:

        this.Form.DefaultButton = Tools.FindControl(CreateUserWizard1, "FinishButton").UniqueID;

And the create user event is not fired when I hit enter.

Any idea?

GianT971
  • 4,385
  • 7
  • 34
  • 46

2 Answers2

1

I finally found it, its ID is "StepNextButtonButton"

GianT971
  • 4,385
  • 7
  • 34
  • 46
0

how about try something like

    foreach (Control ctrl in this.form1.Controls)
    {
        if (ctrl.GetType() == typeof(Button) && (ctrl as Button).Text == "Button2")
        {
            this.form1.DefaultButton = ctrl.ID;
        }
    }
a7mad.3ezz
  • 101
  • 1
  • 6
  • Will not work, will just stick at the first children level, whereas there are usually many inner control levels – GianT971 Oct 24 '11 at 18:42