The inheritable forms in NetXP are provided so that your applications can have a common look and feel. There are several such forms provided in NetXP, listed below:
Like any inheritable form in NetXP, you have to create a new Inherited Form in your project, and browse for the NETXP.Forms.dll. From the list of forms in that DLL, choose About and click OK. A new form will be created which inherits from the NetXP about box. Below are some screenshots illustrating these steps.
Select Add Inherited Form....
Click Browse....
Select NETXP.Forms.dll and click Open.
Select the form you wish to inherit.
This form provides, among other things, a list of loaded assemblies. The code for populating this list is given below.
foreach (System.Reflection.Assembly s in AppDomain.CurrentDomain.GetAssemblies()) { string[] lvsi = new string[3]; lvsi[0] = s.GetName().Name; lvsi[1] = s.GetName().FullName; lvsi[2] = s.GetName().Version.ToString(); System.Windows.Forms.ListViewItem lvi = new ListViewItem(lvsi, 0); this.ListOfAssemblies.Items.Add(lvi); }
This form is set up so that it has a fixed dialog border and no minimize or maximize buttons. It is also shown centered and it is not shown in the task bar. This form contains an OK button and a Cancel button, which are fully customizable and are set as the AcceptButton and CancelButton properties respectively.
This form provides an inheritable, reusable popup form that implements all the functionality of a typical popup window. Important: Call the ShowPopup function instead of the Show function to display a popup form.
Wizard Form
The wizard form provides all the functionality necessary to create a wizard.
You may wish to create your own customized wizard without inheriting from NetXP's Wizard form. To do so, you should use the NetXP MultiPage control to store your wizard pages, and name it WizardPages. You should have Back, Next/Finish, and Cancel buttons. These should be called BackButton, NextButton, and CancelBtn, respectively. You should start out with the Back button disabled, and all other buttons enabled.
When Next is clicked, you should execute this code:
if(this.WizardPages.SelectedIndex < this.WizardPages.TabCount-1) { this.WizardPages.SelectedIndex++; } else { this.DialogResult = DialogResult.OK; this.Close(); } if(this.WizardPages.SelectedIndex >= 1) { this.BackButton.Enabled = true; } if(this.WizardPages.SelectedIndex == this.WizardPages.TabCount-1) { this.NextButton.Text = "Finish"; this.NextButton.Focus(); }
When Back is clicked, you should execute this code:
if(this.WizardPages.SelectedIndex > 0) { this.WizardPages.SelectedIndex--; } if(this.WizardPages.SelectedIndex == 0) { this.BackButton.Enabled = false; this.BackButton.Refresh(); } if(this.WizardPages.SelectedIndex == this.WizardPages.TabCount-2) { this.NextButton.Text = "Next >"; }