
## ListBox class

Represents a list box object.



**Inheritance:** [`ListBox`](/cells/python-net/aspose.cells.drawing/listbox) → 
[`Shape`](/cells/python-net/aspose.cells.drawing/shape)



The ListBox type exposes the following members:

### Properties
| Property | Description |
| :- | :- |
| [macro_name](/cells/python-net/aspose.cells.drawing/listbox/macro_name) | Gets and sets the name of macro. |
| [is_equation](/cells/python-net/aspose.cells.drawing/listbox/is_equation) | Indicates whether the shape only contains an equation. |
| [is_smart_art](/cells/python-net/aspose.cells.drawing/listbox/is_smart_art) | Indicates whether the shape is a smart art. |
| [z_order_position](/cells/python-net/aspose.cells.drawing/listbox/z_order_position) | Returns the position of a shape in the z-order. |
| [name](/cells/python-net/aspose.cells.drawing/listbox/name) | Gets and sets the name of the shape. |
| [alternative_text](/cells/python-net/aspose.cells.drawing/listbox/alternative_text) | Returns or sets the descriptive (alternative) text string of the [`Shape`](/cells/python-net/aspose.cells.drawing/shape) object. |
| [title](/cells/python-net/aspose.cells.drawing/listbox/title) | Specifies the title (caption) of the current shape object. |
| [line_format](/cells/python-net/aspose.cells.drawing/listbox/line_format) | Returns a MsoLineFormat object that contains line formatting properties for the specified shape. |
| [fill_format](/cells/python-net/aspose.cells.drawing/listbox/fill_format) | Returns a MsoFillFormat object that contains fill formatting properties for the specified shape. |
| [line](/cells/python-net/aspose.cells.drawing/listbox/line) | Gets line style |
| [fill](/cells/python-net/aspose.cells.drawing/listbox/fill) | Returns a [`Shape.fill_format`](/cells/python-net/aspose.cells.drawing/shape#fill_format) object that contains fill formatting properties for the specified shape. |
| [shadow_effect](/cells/python-net/aspose.cells.drawing/listbox/shadow_effect) | Represents a [`ShadowEffect`](/cells/python-net/aspose.cells.drawing/shadoweffect) object that specifies shadow effect for the chart element or shape. |
| [reflection](/cells/python-net/aspose.cells.drawing/listbox/reflection) | Represents a [`ReflectionEffect`](/cells/python-net/aspose.cells.drawing/reflectioneffect) object that specifies reflection effect for the chart element or shape. |
| [glow](/cells/python-net/aspose.cells.drawing/listbox/glow) | Represents a [`GlowEffect`](/cells/python-net/aspose.cells.drawing/gloweffect) object that specifies glow effect for the chart element or shape. |
| [soft_edges](/cells/python-net/aspose.cells.drawing/listbox/soft_edges) | Gets and sets the radius of blur to apply to the edges, in unit of points. |
| [three_d_format](/cells/python-net/aspose.cells.drawing/listbox/three_d_format) | Gets and sets 3d format of the shape. |
| [format_picture](/cells/python-net/aspose.cells.drawing/listbox/format_picture) | Gets and sets the options of the picture format. |
| [is_hidden](/cells/python-net/aspose.cells.drawing/listbox/is_hidden) | Indicates whether the object is visible. |
| [is_lock_aspect_ratio](/cells/python-net/aspose.cells.drawing/listbox/is_lock_aspect_ratio) | True means that aspect ratio of the shape is locked. |
| [is_aspect_ratio_locked](/cells/python-net/aspose.cells.drawing/listbox/is_aspect_ratio_locked) | True means that aspect ratio of the shape is locked. |
| [rotation_angle](/cells/python-net/aspose.cells.drawing/listbox/rotation_angle) | Gets and sets the rotation of the shape. |
| [hyperlink](/cells/python-net/aspose.cells.drawing/listbox/hyperlink) | Gets the hyperlink of the shape. |
| [id](/cells/python-net/aspose.cells.drawing/listbox/id) | Gets the identifier of this shape. |
| [spid](/cells/python-net/aspose.cells.drawing/listbox/spid) | Specifies an optional string identifier that an application can use to identify the particular shape. |
| [spt](/cells/python-net/aspose.cells.drawing/listbox/spt) | Specifies an optional number that an application can use to associate the particular shape with a defined shape type. |
| [worksheet](/cells/python-net/aspose.cells.drawing/listbox/worksheet) | Gets the [`Shape.worksheet`](/cells/python-net/aspose.cells.drawing/shape#worksheet) object which contains this shape. |
| [is_group](/cells/python-net/aspose.cells.drawing/listbox/is_group) | Indicates whether this shape is a group shape. |
| [is_in_group](/cells/python-net/aspose.cells.drawing/listbox/is_in_group) | Indicates whether the shape is grouped. |
| [is_word_art](/cells/python-net/aspose.cells.drawing/listbox/is_word_art) | Indicates whether this shape is a word art. |
| [text_effect](/cells/python-net/aspose.cells.drawing/listbox/text_effect) | Returns a TextEffectFormat object that contains text-effect formatting properties for the specified shape. <br/>Applies to Shape objects that represent WordArt. |
| [is_locked](/cells/python-net/aspose.cells.drawing/listbox/is_locked) | True means the object can not be modified when the sheet is protected. <br/>Note that this value is meaningful only if the worksheet or objects in the worksheet are protected. |
| [is_printable](/cells/python-net/aspose.cells.drawing/listbox/is_printable) | Indicates whether the object is printable.<br/>If False, this shape will not be printed when printing. |
| [mso_drawing_type](/cells/python-net/aspose.cells.drawing/listbox/mso_drawing_type) | Gets drawing type. |
| [auto_shape_type](/cells/python-net/aspose.cells.drawing/listbox/auto_shape_type) | Gets and sets the auto shape type. |
| [anchor_type](/cells/python-net/aspose.cells.drawing/listbox/anchor_type) | Gets and set the type of the shape anchor placeholder. |
| [placement](/cells/python-net/aspose.cells.drawing/listbox/placement) | Represents the way the drawing object is attached to the cells below it.<br/>The property controls the placement of an object on a worksheet. |
| [upper_left_row](/cells/python-net/aspose.cells.drawing/listbox/upper_left_row) | Represents the top row index. |
| [upper_delta_y](/cells/python-net/aspose.cells.drawing/listbox/upper_delta_y) | Gets or sets the shape's vertical offset from its upper left corner row. |
| [upper_left_column](/cells/python-net/aspose.cells.drawing/listbox/upper_left_column) | Represents upper left corner column index. |
| [upper_delta_x](/cells/python-net/aspose.cells.drawing/listbox/upper_delta_x) | Gets or sets the shape's horizontal offset from its upper left corner column. |
| [lower_right_row](/cells/python-net/aspose.cells.drawing/listbox/lower_right_row) | Represents lower right corner row index. |
| [lower_delta_y](/cells/python-net/aspose.cells.drawing/listbox/lower_delta_y) | Gets or sets the shape's vertical offset from its lower right corner row. |
| [lower_right_column](/cells/python-net/aspose.cells.drawing/listbox/lower_right_column) | Represents lower right corner column index. |
| [lower_delta_x](/cells/python-net/aspose.cells.drawing/listbox/lower_delta_x) | Gets or sets the shape's horizontal  offset from its lower right corner column. |
| [right](/cells/python-net/aspose.cells.drawing/listbox/right) | Represents the width of the shape's horizontal  offset from its lower right corner column, in unit of pixels. |
| [bottom](/cells/python-net/aspose.cells.drawing/listbox/bottom) | Represents the width of the shape's vertical offset from its lower bottom corner row, in unit of pixels. |
| [width](/cells/python-net/aspose.cells.drawing/listbox/width) | Represents the width of shape, in unit of pixels. |
| [width_inch](/cells/python-net/aspose.cells.drawing/listbox/width_inch) | Represents the width of the shape, in unit of inch. |
| [width_pt](/cells/python-net/aspose.cells.drawing/listbox/width_pt) | Represents the width of the shape, in unit of point. |
| [width_cm](/cells/python-net/aspose.cells.drawing/listbox/width_cm) | Represents the width of the shape, in unit of centimeters. |
| [height](/cells/python-net/aspose.cells.drawing/listbox/height) | Represents the height of shape, in unit of pixel. |
| [height_inch](/cells/python-net/aspose.cells.drawing/listbox/height_inch) | Represents the height of the shape, in unit of inches. |
| [height_pt](/cells/python-net/aspose.cells.drawing/listbox/height_pt) | Represents the height of the shape, in unit of points. |
| [height_cm](/cells/python-net/aspose.cells.drawing/listbox/height_cm) | Represents the height of the shape, in unit of centimeters. |
| [left](/cells/python-net/aspose.cells.drawing/listbox/left) | Represents the horizontal offset of shape from its left column, in unit of pixels. |
| [left_inch](/cells/python-net/aspose.cells.drawing/listbox/left_inch) | Represents the horizontal offset of shape from its left column, in unit of inches. |
| [left_cm](/cells/python-net/aspose.cells.drawing/listbox/left_cm) | Represents the horizontal offset of shape from its left column, in unit of centimeters. |
| [top](/cells/python-net/aspose.cells.drawing/listbox/top) | Represents the vertical offset of shape from its top row, in unit of pixels. |
| [top_inch](/cells/python-net/aspose.cells.drawing/listbox/top_inch) | Represents the vertical offset of shape from its top row, in unit of inches. |
| [top_cm](/cells/python-net/aspose.cells.drawing/listbox/top_cm) | Represents the vertical offset of shape from its top row, in unit of centimeters. |
| [top_to_corner](/cells/python-net/aspose.cells.drawing/listbox/top_to_corner) | Gets and sets the vertical offset of shape from worksheet top border, in unit of pixels. |
| [left_to_corner](/cells/python-net/aspose.cells.drawing/listbox/left_to_corner) | Gets and sets the horizonal offset of shape from worksheet left border. |
| [x](/cells/python-net/aspose.cells.drawing/listbox/x) | Gets and sets the horizontal offset of shape from worksheet left border,in unit of pixels. |
| [y](/cells/python-net/aspose.cells.drawing/listbox/y) | Gets and sets the vertical offset of shape from worksheet top border,in unit of pixels. |
| [width_scale](/cells/python-net/aspose.cells.drawing/listbox/width_scale) | Gets and sets the width scale, in unit of percent of the original picture width.<br/>If the shape is not picture ,the WidthScale property only returns 100; |
| [height_scale](/cells/python-net/aspose.cells.drawing/listbox/height_scale) | Gets and sets the height scale,in unit of percent of the original picture height.<br/>If the shape is not picture ,the HeightScale property only returns 100; |
| [top_in_shape](/cells/python-net/aspose.cells.drawing/listbox/top_in_shape) | Represents the vertical offset of shape from the top border of the parent shape, <br/>in unit of 1/4000 of height of the parent shape. |
| [left_in_shape](/cells/python-net/aspose.cells.drawing/listbox/left_in_shape) | Represents the horizontal offset of shape from the left border of the parent shape, <br/>in unit of 1/4000 of width of the parent shape. |
| [width_in_shape](/cells/python-net/aspose.cells.drawing/listbox/width_in_shape) | Represents the width of the shape, in unit of 1/4000 of the parent shape. |
| [height_in_shape](/cells/python-net/aspose.cells.drawing/listbox/height_in_shape) | Represents the vertical offset of shape from the top border of the parent shape, in unit of 1/4000 of height of the parent shape.. |
| [group](/cells/python-net/aspose.cells.drawing/listbox/group) | Gets the group shape which contains this shape. |
| [type](/cells/python-net/aspose.cells.drawing/listbox/type) | Gets the auto shape type. |
| [has_line](/cells/python-net/aspose.cells.drawing/listbox/has_line) | Gets and sets the line border of the shape is visible. |
| [is_filled](/cells/python-net/aspose.cells.drawing/listbox/is_filled) | Indicates whether the fill format is visible. |
| [is_flipped_horizontally](/cells/python-net/aspose.cells.drawing/listbox/is_flipped_horizontally) | Gets and sets whether shape is horizontally flipped . |
| [is_flipped_vertically](/cells/python-net/aspose.cells.drawing/listbox/is_flipped_vertically) | Gets and sets whether shape is vertically flipped . |
| [actual_lower_right_row](/cells/python-net/aspose.cells.drawing/listbox/actual_lower_right_row) | Get the actual bottom row. |
| [relative_to_original_picture_size](/cells/python-net/aspose.cells.drawing/listbox/relative_to_original_picture_size) | Indicates whether shape is relative to original picture size. |
| [linked_cell](/cells/python-net/aspose.cells.drawing/listbox/linked_cell) | Gets or sets the worksheet range linked to the control's value. |
| [input_range](/cells/python-net/aspose.cells.drawing/listbox/input_range) | Gets or sets the worksheet range used to fill the specified combo box. |
| [text_shape_type](/cells/python-net/aspose.cells.drawing/listbox/text_shape_type) | Gets and sets the preset text shape type. |
| [text_body](/cells/python-net/aspose.cells.drawing/listbox/text_body) | Gets and sets the setting of the shape's text. |
| [font](/cells/python-net/aspose.cells.drawing/listbox/font) | Represents the font of shape. |
| [text_options](/cells/python-net/aspose.cells.drawing/listbox/text_options) | Represents the text options of the shape. |
| [text](/cells/python-net/aspose.cells.drawing/listbox/text) | Gets and sets the text of this shape. |
| [is_rich_text](/cells/python-net/aspose.cells.drawing/listbox/is_rich_text) | Whether or not the text is rich text. |
| [html_text](/cells/python-net/aspose.cells.drawing/listbox/html_text) | Gets and sets the html string which contains data and some formats in this textbox. |
| [text_vertical_overflow](/cells/python-net/aspose.cells.drawing/listbox/text_vertical_overflow) | Gets and sets the text vertical overflow type of the shape which contains text. |
| [text_horizontal_overflow](/cells/python-net/aspose.cells.drawing/listbox/text_horizontal_overflow) | Gets and sets the text horizontal overflow type of the shape which contains text. |
| [is_text_wrapped](/cells/python-net/aspose.cells.drawing/listbox/is_text_wrapped) | Gets and sets the text wrapped type of the shape which contains text. |
| [text_orientation_type](/cells/python-net/aspose.cells.drawing/listbox/text_orientation_type) | Gets and sets the text orientation type of the shape. |
| [text_horizontal_alignment](/cells/python-net/aspose.cells.drawing/listbox/text_horizontal_alignment) | Gets and sets the text horizontal alignment type of the shape. |
| [text_vertical_alignment](/cells/python-net/aspose.cells.drawing/listbox/text_vertical_alignment) | Gets and sets the text vertical alignment type of the shape. |
| [text_direction](/cells/python-net/aspose.cells.drawing/listbox/text_direction) | Gets/Sets the direction of the text flow for this object. |
| [text_box_options](/cells/python-net/aspose.cells.drawing/listbox/text_box_options) | Gets the text information in the shape |
| [control_data](/cells/python-net/aspose.cells.drawing/listbox/control_data) | Gets the data of control. |
| [active_x_control](/cells/python-net/aspose.cells.drawing/listbox/active_x_control) | Gets the ActiveX control. |
| [paths](/cells/python-net/aspose.cells.drawing/listbox/paths) | Gets the paths of a custom geometric shape. |
| [geometry](/cells/python-net/aspose.cells.drawing/listbox/geometry) | Gets the geometry |
| [create_id](/cells/python-net/aspose.cells.drawing/listbox/create_id) | Gets and sets create id for this shape. |
| [is_decorative](/cells/python-net/aspose.cells.drawing/listbox/is_decorative) | Indicates whether the object is decorative. |
| [item_count](/cells/python-net/aspose.cells.drawing/listbox/item_count) | Gets the number of items in the list box. |
| [selected_index](/cells/python-net/aspose.cells.drawing/listbox/selected_index) | Gets or sets the index number of the currently selected item in a list box or combo box.<br/>Zero-based. |
| [selected_cells](/cells/python-net/aspose.cells.drawing/listbox/selected_cells) | Gets the selected cells.<br/>Returns null if the input range is not set or no item is selected |
| [shadow](/cells/python-net/aspose.cells.drawing/listbox/shadow) | Indicates whether the combobox has 3-D shading. |
| [selection_type](/cells/python-net/aspose.cells.drawing/listbox/selection_type) | Gets or sets the selection mode of the specified list box. |
| [page_change](/cells/python-net/aspose.cells.drawing/listbox/page_change) | Specifies the amount by which the control's value is changed <br/>when the user clicks on the scrollbar's page up or page down region. |


### Methods
| Method | Description |
| :- | :- |
| [`to_image(self, stream, image_type)`](/cells/python-net/aspose.cells.drawing/listbox/to_image/#io.rawiobase-aspose.cells.drawing.imagetype) | Creates the shape image and saves it to a stream in the specified format. |
| [`to_image(self, image_file, options)`](/cells/python-net/aspose.cells.drawing/listbox/to_image/#system.string-aspose.cells.rendering.imageorprintoptions) | Saves the shape to a file. |
| [`to_image(self, stream, options)`](/cells/python-net/aspose.cells.drawing/listbox/to_image/#io.rawiobase-aspose.cells.rendering.imageorprintoptions) | Saves the shape to a stream. |
| [`get_result_of_smart_art(self)`](/cells/python-net/aspose.cells.drawing/listbox/get_result_of_smart_art/#) | Converting smart art to grouped shapes. |
| [`to_front_or_back(self, orders)`](/cells/python-net/aspose.cells.drawing/listbox/to_front_or_back/#int) | Brings the shape to the front or sends the shape to back. |
| [`get_locked_property(self, type)`](/cells/python-net/aspose.cells.drawing/listbox/get_locked_property/#aspose.cells.drawing.shapelocktype) | Gets the value of locked property. |
| [`set_locked_property(self, type, value)`](/cells/python-net/aspose.cells.drawing/listbox/set_locked_property/#aspose.cells.drawing.shapelocktype-bool) | Set the locked property. |
| [`add_hyperlink(self, address)`](/cells/python-net/aspose.cells.drawing/listbox/add_hyperlink/#system.string) | Adds a hyperlink to the shape. |
| [`remove_hyperlink(self)`](/cells/python-net/aspose.cells.drawing/listbox/remove_hyperlink/#) | Removes the hyperlink of the shape. |
| [`move_to_range(self, top_row, left_column, bottom_row, right_column)`](/cells/python-net/aspose.cells.drawing/listbox/move_to_range/#int-int-int-int) | Moves the shape to a specified range. |
| [`align_top_right_corner(self, top_row, right_column)`](/cells/python-net/aspose.cells.drawing/listbox/align_top_right_corner/#int-int) | Moves the picture to the top-right corner. |
| [`get_connection_points(self)`](/cells/python-net/aspose.cells.drawing/listbox/get_connection_points/#) | Get the connection points |
| [`get_linked_cell(self, is_r1c1, is_local)`](/cells/python-net/aspose.cells.drawing/listbox/get_linked_cell/#bool-bool) | Gets the range linked to the control's value. |
| [`set_linked_cell(self, formula, is_r1c1, is_local)`](/cells/python-net/aspose.cells.drawing/listbox/set_linked_cell/#system.string-bool-bool) | Sets the range linked to the control's value. |
| [`get_input_range(self, is_r1c1, is_local)`](/cells/python-net/aspose.cells.drawing/listbox/get_input_range/#bool-bool) | Gets the range used to fill the control. |
| [`set_input_range(self, formula, is_r1c1, is_local)`](/cells/python-net/aspose.cells.drawing/listbox/set_input_range/#system.string-bool-bool) | Sets the range used to fill the control. |
| [`update_selected_value(self)`](/cells/python-net/aspose.cells.drawing/listbox/update_selected_value/#) | Update the selected value by the value of the linked cell. |
| [`calculate_text_size(self)`](/cells/python-net/aspose.cells.drawing/listbox/calculate_text_size/#) | Recalculate the text area |
| [`format_characters(self, start_index, length, font, flag)`](/cells/python-net/aspose.cells.drawing/listbox/format_characters/#int-int-aspose.cells.font-aspose.cells.styleflag) | Formats some characters with the font setting. |
| [`characters(self, start_index, length)`](/cells/python-net/aspose.cells.drawing/listbox/characters/#int-int) | Returns a Characters object that represents a range of characters within the text. |
| [`get_characters(self)`](/cells/python-net/aspose.cells.drawing/listbox/get_characters/#) | Returns all Characters objects <br/>that represents a range of characters within the text . |
| [`get_rich_formattings(self)`](/cells/python-net/aspose.cells.drawing/listbox/get_rich_formattings/#) | Returns all Characters objects <br/>that represents a range of characters within the text . |
| [`remove_active_x_control(self)`](/cells/python-net/aspose.cells.drawing/listbox/remove_active_x_control/#) | Remove activeX control. |
| [`is_same_setting(self, obj)`](/cells/python-net/aspose.cells.drawing/listbox/is_same_setting/#system.object) | Returns whether the shape is same. |
| [`get_actual_box(self)`](/cells/python-net/aspose.cells.drawing/listbox/get_actual_box/#) | Get the actual position and size of the shape (after applying rotation, flip, etc.) |
| [`fit_to_text_size(self)`](/cells/python-net/aspose.cells.drawing/listbox/fit_to_text_size/#) | Recalculate a text area suitable for displaying all text content. |
| [`selected_item(self, item_index, is_selected)`](/cells/python-net/aspose.cells.drawing/listbox/selected_item/#int-bool) | Sets whether the item is selected |
| [`is_selected(self, item_index)`](/cells/python-net/aspose.cells.drawing/listbox/is_selected/#int) | Indicates whether the item is selected. |



### Example 


```python
from aspose.cells import Workbook
from aspose.cells.drawing import PlacementType, SelectionType

# Create a new Workbook.
workbook = Workbook()
# Get the first worksheet.
sheet = workbook.worksheets[0]
# Get the worksheet cells collection.
cells = sheet.cells
# Input a value.
cells.get("B3").put_value("Choose Dept:")
# Set it bold.
style = cells.get("B3").get_style()
style.font.is_bold = True
cells.get("B3").set_style(style)
# Input some values that denote the input range
# for the list box.
cells.get("A2").put_value("Sales")
cells.get("A3").put_value("Finance")
cells.get("A4").put_value("MIS")
cells.get("A5").put_value("R&D")
cells.get("A6").put_value("Marketing")
cells.get("A7").put_value("HRA")
# Add a new list box.
listBox = sheet.shapes.add_list_box(2, 0, 3, 0, 122, 100)
# Set the placement type.
listBox.placement = PlacementType.FREE_FLOATING
# Set the linked cell.
listBox.linked_cell = "A1"
# Set the input range.
listBox.input_range = "A2:A7"
# Set the selection style.
listBox.selection_type = SelectionType.SINGLE
# Set the list box with 3-D shading.
listBox.shadow = True
# Saves the file.
workbook.save(r"tstlistbox.xls")

```

### See Also
* module [`aspose.cells.drawing`](..)
* class [`GlowEffect`](/cells/python-net/aspose.cells.drawing/gloweffect)
* class [`ListBox`](/cells/python-net/aspose.cells.drawing/listbox)
* class [`ReflectionEffect`](/cells/python-net/aspose.cells.drawing/reflectioneffect)
* class [`ShadowEffect`](/cells/python-net/aspose.cells.drawing/shadoweffect)
* class [`Shape`](/cells/python-net/aspose.cells.drawing/shape)
