[]
You can use the name box control to display or create custom names at run time. Custom names that are created by the name box can only refer to a cell or a range of cells.
Select the name box control from the Toolbox and draw it on the form or use the NameBox class to create the control at runtime. Then attach the control to Spread. The following image displays the NameBox control in the toolbox.
To create a custom name, select a cell or range of cells in the Spread control, type a custom name in the name box control, and then press the equal key to create the custom name.
Use the drop-down list in the name box control to display the custom names. You can select one of the names to see the cell or cell range that the name refers to.
Create the name box and attach it to the control.
This example code creates a name box control and a custom name.
fpSpread1.ActiveSheet.AddCustomName("Alpha", "A1:B1", 0, 0);
FarPoint.Win.Spread.NameBox namebox1 = new FarPoint.Win.Spread.NameBox();
namebox1.Location = new Point(0, 0);
namebox1.Size = new Size(80, 20);
this.Controls.Add(namebox1);
namebox1.Attach(fpSpread1);
fpSpread1.ActiveSheet.AddCustomName("Alpha", "A1:B1", 0, 0)
Dim namebox1 As New FarPoint.Win.Spread.NameBox()
namebox1.Location = New Point(0, 0)
namebox1.Size = New Size(80, 20)
Controls.Add(namebox1)
namebox1.Attach(fpSpread1)
Specifying a Cell Reference in a Formula
Specifying a Sheet Reference in a Formula
Specifying an External Reference in a Formula
Using a Circular Reference in a Formula
Nesting Functions in a Formula
Recalculating and Updating Formulas Automatically
Finding a Value Using GoalSeek
Allowing the User to Enter Formulas
Creating and Using a Custom Name
Creating and Using a Custom Function
Creating and Using External Variable
Working with the Formula Text Box