Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Developers can add different drawing objects such as text boxes, check boxes, radio buttons, combo boxes, labels, buttons, lines, rectangles, arcs, ovals, spinners, scroll bars, group boxes etc. Aspose.Cells provides the Aspose.Cells.Drawing namespace which contains all the drawing objects. However, there are a few drawing objects or shapes that are not supported yet. Create these drawing objects in a designer spreadsheet using Microsoft Excel and then import the designer spreadsheet to Aspose.Cells. Aspose.Cells allows you to load these drawing objects from a designer spreadsheet and write them to a generated file.
One way to stress important information in a report is to use a text box. For example, add text to highlight the company name or to indicate the geographic region with the highest sales etc. Aspose.Cells provides the TextBoxCollection class, used to add a new text box to the collection. There is another class, TextBox, which represents a text box used to define all types of settings. It has some important members:
The following example creates two textboxes in the first worksheet of the workbook. The first text box is well-furnished with different format settings. The second is a simple one.
Aspose.Cells also lets you access textboxes in the designer worksheets and manipulate them. Use the Worksheet.TextBoxes property to get the textboxes collection in the sheet.
The following example uses the Microsoft Excel file that we created in the above example. It gets the text strings of the two textboxes and changes the text of the second textbox to save the file.
Check boxes are handy if you want to provide a way for a user to choose between two options, such as true or false; yes or no. Aspose.Cells allows you to use check boxes in worksheets. For instance, you may have developed a financial projection worksheet in which you can either account for a particular acquisition or not. In this case, you might want to place a check box at the top of the worksheet. You can then link the status of this check box to another cell, so that if the check box is selected, the value of the cell is True; if it is not selected, the value of the cell is False.
To place a check box control in your worksheet, follow these steps:
Aspose.Cells provides the CheckBoxCollection class, which is used to add a new check box to the collection. There is another class, Aspose.Cells.Drawing.CheckBox, which represents a check box. It has some important members:
The following example shows how to add a checkbox to the worksheet.
A radio button, or an option button, is a control made of a round box. The user makes his or her decision by selecting the round box. A radio button is usually, if not always, accompanied by others. Such radio buttons appear and behave as a group. The user decides which button is valid by selecting only one of them. When the user clicks one button, it is filled. When one button in the group is selected, buttons of the same group are empty.
To place a Radio Button control in your worksheet, follow these steps:
Aspose.Cells.Drawing.ShapeCollection class provides a method named AddRadioButton, which is used to add a radio button control to a worksheet. The method returns an Aspose.Cells.Drawing.RadioButton object. The classAspose.Cells.Drawing.RadioButton represents an option button. It has some important members:
The following example shows how to add radio buttons to a worksheet. The example adds three radio buttons representing age groups.
To make data entry easier, or to limit entries to certain items that you define, you can create a combo box, or drop-down list of valid entries that is compiled from cells elsewhere on the worksheet. When you create a drop-down list for a cell, it displays an arrow next to that cell. To enter information in that cell, click the arrow, and then click the entry that you want.
To place a combo box control in your worksheet, follow these steps:
The Aspose.Cells.Drawing.ShapeCollection class provides a method named AddComboBox, which is used to add a combo box control to a worksheet. The method returns an Aspose.Cells.Drawing.ComboBox object. The class Aspose.Cells.Drawing.ComboBox represents a combo box. It has some important members:
The following example shows how to add a combo box to the worksheet.
Labels are a means of give users information about a speadsheet’s contents. Aspose.Cells makes it possible to add and manipulate labels in a worksheet. The ShapeCollection class provides a method named AddLabel, used to add a label control to the worksheet. The method returns a Label object. The class Label represents a label in the worksheet. It has some important members:
The following example shows how to add a label to the worksheet.
A list box control creates a list control that allows single or multiple item selection.
To place a list box control in a worksheet:
The ShapeCollection class provides a method named AddListBox, which is used to add a list box control to a worksheet. The method returns a Aspose.Cells.Drawing.ListBox object. The class ListBox represents a list box. It has some important members:
The following example shows how to add a list box to the worksheet.
Buttons are useful to perform some actions. Sometimes, it is useful to assign a VBA Macro to the button or assign a hyperlink to open a web page.
To place a button control in your worksheet:
The ShapeCollection class provides a method named AddButton, used to add a button control to the worksheet. The method returns an Aspose.Cells.Drawing.Button object. The class Aspose.Cells.Drawing.Button represents a button. It has some important members:
The following example shows how to add a button to the worksheet.
The ShapeCollection class provides a method named AddLine, which is used to add a line shape to the worksheet. The method return a LineShape object. The class LineShape represents a line. It has some important members:
The following example shows how to add lines to the worksheet. It creates three lines with different styles.
Aspose.Cells also allows you to draw arrow lines. It is possible to add an arrowhead to a line, and to format the line. For example, you can change the color of the line, or specify the weight and style of the line.
The following example shows how to add an arrowhead to a line.
Aspose.Cells allows you to draw rectangle shapes in your worksheets. You may create a rectangle, square etc. You are also allowed to format the filling color and border line color of the control. For example, you can change the color of the rectangle, set the shading color, specify the weight and style of the rectangle for your need.
The ShapeCollection class provides a method named AddRectangle, which is used to add a rectangle shape to a worksheet. The method returns Aspose.Cells.Drawing.RectangleShape object. The class Aspose.Cells.Drawing.RectangleShape represents a rectangle. It has some important members:
The following example shows how to add a rectangle to the worksheet.
Aspose.Cells allows you to draw arc shapes in your worksheets. You may create simple and filled arcs. You are allowed to format the filling color and border line color of the control. For example, you can specify / change the color of the arc, set the shading color, specify the weight and style of the shape for your need.
The ShapeCollection class provides a method named AddArc, which is used to add an arc shape to a worksheet. The method returns an Aspose.Cells.Drawing.ArcShape object. The class Aspose.Cells.Drawing.ArcShape represents an arc. It has some important members:
The following example shows how to add arc shapes to the worksheet. The example creates two arc shapes: one is filled and other is simple.
Aspose.Cells allows you to draw oval shapes in worksheets. Create simple and filled oval shapes and format the filling color and border line color of the control. For example, you can specify / change the color of the oval, set the shading color, specify the weight and style of the shape.
The ShapeCollection class provides a method named AddOval, which is used to add an oval shape to a worksheet. The method returns an Aspose.Cells.Drawing.Oval object. The class Aspose.Cells.Drawing.Oval represents an oval shape. It has some important members:
The following example shows how to add oval shapes to the worksheet. The example creates two oval shapes: one is filled oval other is a simple circle.
A spin box is a text box attached to a button (called a spin button) consisting of an up arrow and down arrow that you click to incrementally change the value in the text box. By using spin boxes, you can see how input changes to your financial model will alter the model outputs. You can attach a spin button to a specific input cell. While you click the up arrow or down arrow on the spin button, the integer value in the targeted input cell increases or decreases. Aspose.Cells allows you to create spinners in your worksheets.
To place a spin box control in your worksheet:
The ShapeCollection class provides a method named AddSpinner, which is used to add a spin box control to a worksheet. The method returns an Aspose.Cells.Drawing.Spinner object. The class Aspose.Cells.Drawing.Spinner represents a spin box. It has some important members:
The following example shows how to add a spin box to the worksheet.
A scroll bar control is used to help select data on a worksheet in a similar way to a spin box control. By adding the control to a worksheet and linking it to a cell, it is possible to return a numeric value for the current position of the control.
When you click the up or down control on the scroll bar, cell G1 is updated to a number that indicates the current value of the scroll bar plus or minus the incremental change of the scroll bar.
The ShapeCollection class provides a method named AddScrollBar, which is used to add a scroll bar control to the worksheet. The method returns an Aspose.Cells.Drawing.ScrollBar object. The class Aspose.Cells.Drawing.ScrollBar represents a scroll bar. It has some important members:
The following example shows how to add a scroll bar to the worksheet.
Sometimes you do need to implement radio buttons or other controls which belong to a certain group, you can implement by including either a group box or rectangle control. Any of these two objects would serve as the delimiter of the group. After adding one of these shapes, you can then add two or more radio buttons or other group objects.
To place a group box control in your worksheet and place controls in it:
The ShapeCollection class provides a method named AddGroupBox, which is used to add a group box control to the worksheet. The method returns an Aspose.Cells.Drawing.GroupBox object. Moreover, the Group method of the ShapeCollection class groups the shapes, it takes a Shape array as parameter and returns a GroupShape object. The class Aspose.Cells.Drawing.GroupBox represents a group box. It has some important members:
The following example shows how to add a group box and group the controls in the worksheet.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.