Hallo,
i'm reading: http://www.devexpress.com/Support/Center/p/Q242160.aspx
-------------------------------------
Hello Alwin,
This is not a workaround, but a documented feature. This event is used to customize command buttons. As for the AllowNext property, the current behavior is correct. As described in the documentation, this property enables or disables the Next button. Since the Completion Page is removed, on the last page the Next button is replaced with the Finish button. The AllowNext property shouldn't modify the properties of the Finish button. If the Next button is restored, it will be enabled or disabled according to the AllowNext property.
Thanks,
Uriah.
------------------------------------
But i need to deactivate the finish button on code behind! How does it works?
With best regards,
Anastasius
We have closed this ticket because another page addresses its subject:
finish button
Hi Anastasius,
Thank you for your question. As stated in the original message, to introduce this feature you can handle the CustomizeCommandButtons event. I have attached a sample project, which demonstrates how to implement this feature. Please review it and inform me whether this approach suits your needs.
Thanks,
Stan.
Hi Stan,
thanks for your example and answer.
You use this event to set the finish button to "visible = false".
Did you know a way to set the button "enable = false"?
Thanks for your help!
Anastasius
Hi Bernhard,
You can accomplish this task by creating a custom WizardButton in the following manner:
WizardButton customButton; public Form1() { InitializeComponent(); customButton = new WizardButton(wizardControl1); customButton.Visible = false; customButton.SetText("Finish"); customButton.TabIndex = 2; wizardControl1.CustomizeCommandButtons += new DevExpress.XtraWizard.WizardCustomizeCommandButtonsEventHandler(wizardControl1_CustomizeCommandButtons); } private void wizardControl1_CustomizeCommandButtons(object sender, DevExpress.XtraWizard.CustomizeCommandButtonsEventArgs e) { e.FinishButton.Visible = false; if (e.Page is CompletionWizardPage) { customButton.Location = new Point(e.FinishButton.Location.X, e.PrevButton.Location.Y); customButton.Visible = true; customButton.Enabled = false; } else customButton.Visible = false; }
We hope that you find this information helpful.
Thanks,
Svetlana
Hi Svetlana,
thanks!
Anastasius
Hi,
Why we cannot use this solution ?
wizardRestoreControl.Controls[2].Enabled = false;
Hi,
Alternatively, you can use this approach without any problem since WizardControl buttons are located within the WizardControl.Controls collection.
Hopefully someone reads the end of this thread, before trying the code above. The proposed solution where you replace the finish button is problematic and a complete waste of time.
Use Narsa's approach albeit with a type check, just in case the designer ordering changes. Probably unlikely but you never know. Ideally you would iterate the Control and look for the finish button.
Snip of my wizard:
if (wizardControl1.Controls[2].GetType() == typeof(DevExpress.XtraWizard.WizardButton)) wizardControl1.Controls[2].Enabled = true; } catch (Exception ed) { rtbQuery.Text = ed.Message; if (wizardControl1.Controls[2].GetType() == typeof(DevExpress.XtraWizard.WizardButton)) wizardControl1.Controls[2].Enabled = false; }
The way this should have been done by DevExpress is that the WizardControl would have had an AllowFinish property.
Hi,
We will take your opinion into account when we implement new features. Please add the Possibility to disable Finish button in XtraWizard thread to Favorite to be notified of our results.