Namespace EasyXLS.Drawings
Class ExcelComment
System.Object
EasyXLS.Drawings.DrawingObject
EasyXLS.Drawings.LineDrawingObject
EasyXLS.Drawings.FillDrawingObject
EasyXLS.Drawings.DrawingObject2D
EasyXLS.Drawings.ExcelComment
This class stores the comment information like text, font name, font size, font style, foreground and comment position.
-
Constructor Summary
ConstructorDescriptionDefines an instance of the Excel comment.ExcelComment(System.String text)
Defines an instance of the Excel comment having the specified text.ExcelComment(System.String text, int width, int height)
Defines an instance of the Excel comment having the specified text and size.ExcelComment(System.String text, System.String fontName, int fontSize, bool isBold, bool isItalic, System.Drawing.Color foreground)
Defines an instance of the Excel comment having the specified text and font settings. -
Method Summary
Modifier and TypeMethodDescriptionClone()
Creates and returns a copy of this object.System.String
getFont()
Returns the font name of the comment text.int
Returns the font size of the comment text.System.Drawing.Color
Returns the foreground of the comment text.System.String
Returns the value of the comment containing the tags used to set the rich text format in the comment.System.String
getText()
Returns the text of the comment.int
Returns the underline style of the comment text.bool
IsBold()
Returns the bold setting of the comment text.bool
Returns true if the comment contains rich text format.bool
IsItalic()
Returns the italic setting of the comment text.bool
Returns the strikethrough setting of the comment.bool
Returns the subscript setting of the comment.bool
Returns the superscript setting of the comment.void
setBold(bool isBold)
Sets the bold option of the comment text.void
setFont(System.String fontName)
Sets the font name of the comment text.void
setFontSize(int fontSize)
Sets the font size of the comment text.void
setForeground(System.Drawing.Color color)
Sets the foreground of the comment text.void
setHTMLText(System.String text)
Sets the value of the comment using html tags.void
setItalic(bool isItalic)
Sets the italic option of the comment text.void
setStrikethrough(bool isStrikethrough)
Sets the strikethrough option of the comment.void
setSubscript(bool isSubscript)
Sets the subscript option of the comment.void
setSuperscript(bool isSuperscript)
Sets the superscript option of the comment.void
setText(System.String text)
Sets the text of the comment.void
setUnderlineStyle(int underlineStyle)
Sets the underline style of the comment text.Methods inherited from class EasyXLS.Drawings.DrawingObject2D
getLeftUpperCornerColumn, getLeftUpperCornerRow, setLeftUpperCorner, setLeftUpperCorner
Methods inherited from class EasyXLS.Drawings.FillDrawingObject
getFillFormat, setFillFormat
Methods inherited from class EasyXLS.Drawings.LineDrawingObject
getLineColorFormat, getLineStyleFormat, getShadowFormat, setLineColorFormat, setLineStyleFormat, setShadowFormat
Methods inherited from class EasyXLS.Drawings.DrawingObject
getHeight, getHorizontalOffset, getRelativeHeight, getRelativeHorizontalOffset, getRelativeVerticalOffset, getRelativeWidth, getVerticalOffset, getWidth, setLeftUpperOffset, setRelativeLeftUpperOffset, setRelativeSize, setSize
Methods inherited from class System.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ExcelComment
public ExcelComment()Defines an instance of the Excel comment. -
ExcelComment
public ExcelComment(System.String text)Defines an instance of the Excel comment having the specified text.- Parameters:
text
- the text of the comment
-
ExcelComment
public ExcelComment(System.String text, int width, int height)Defines an instance of the Excel comment having the specified text and size.- Parameters:
text
- the text of the commentwidth
- the comment widthheight
- the comment height
-
ExcelComment
public ExcelComment(System.String text, System.String fontName, int fontSize, bool isBold, bool isItalic, System.Drawing.Color foreground)Defines an instance of the Excel comment having the specified text and font settings.- Parameters:
text
- the text of the commentfontName
- the font name of the comment textfontSize
- the font size of the comment textisBold
- the bold option of the comment textisItalic
- the italic option of the comment textforeground
- the foreground of the comment text
-
-
Method Details
-
getText
public System.String getText()Returns the text of the comment.- Returns:
- the text of the comment
- See Also:
setText(System.String)
-
setText
public void setText(System.String text)Sets the text of the comment.- Parameters:
text
- the text of the comment- See Also:
getText()
-
getHTMLText
public System.String getHTMLText()Returns the value of the comment containing the tags used to set the rich text format in the comment. The following tags are supported: <b>, <strong>, <i>, <u>, <underline single>, <underline double>, <underline single-accounting>, <underline double-accounting>, <s>, <strike>, <sup>, <sub>, <font color= face= size=>- Returns:
- the value of the comment containing the tags used to set the rich text format in the comment.
- See Also:
setHTMLText(System.String)
-
setHTMLText
public void setHTMLText(System.String text)Sets the value of the comment using html tags. The html tags are used to set the rich text format in the comment. The following tags are supported: <b>, <strong>, <i>, <u>, <underline single>, <underline double>, <underline single-accounting>, <underline double-accounting>, <s>, <strike>, <sup>, <sub>, <font color= face= size=>- Parameters:
text
- the value of the cell- See Also:
getHTMLText()
-
IsHTMLUsed
public bool IsHTMLUsed()Returns true if the comment contains rich text format.- Returns:
- true if the comment contains rich text format.
- See Also:
setHTMLText(System.String)
-
getFont
public System.String getFont()Returns the font name of the comment text.- Returns:
- the font name of the comment text
- See Also:
setFont(System.String)
-
setFont
public void setFont(System.String fontName)Sets the font name of the comment text.- Parameters:
fontName
- the font name of the comment text- See Also:
getFont()
-
getFontSize
public int getFontSize()Returns the font size of the comment text.- Returns:
- the font size of the comment text
- See Also:
setFontSize(int)
-
setFontSize
public void setFontSize(int fontSize)Sets the font size of the comment text.- Parameters:
fontSize
- the font size of the comment text- See Also:
getFontSize()
-
getForeground
public System.Drawing.Color getForeground()Returns the foreground of the comment text.- Returns:
- the foreground of the comment text
- See Also:
setForeground(System.Drawing.Color)
-
setForeground
public void setForeground(System.Drawing.Color color)Sets the foreground of the comment text.- Parameters:
color
- the foreground of the comment text- See Also:
getForeground()
-
IsBold
public bool IsBold()Returns the bold setting of the comment text.- Returns:
- the bold setting of the comment text
- See Also:
setBold(bool)
-
setBold
public void setBold(bool isBold)Sets the bold option of the comment text.- Parameters:
isBold
- the bold option of the comment text- See Also:
IsBold()
-
IsItalic
public bool IsItalic()Returns the italic setting of the comment text.- Returns:
- the italic setting of the comment text
- See Also:
setItalic(bool)
-
setItalic
public void setItalic(bool isItalic)Sets the italic option of the comment text.- Parameters:
isItalic
- the italic option of the comment text- See Also:
IsItalic()
-
getUnderlineStyle
public int getUnderlineStyle()Returns the underline style of the comment text. Possible values are available inFontSettings
class.- Returns:
- the underline style of the comment text
- See Also:
setUnderlineStyle(int)
-
setUnderlineStyle
public void setUnderlineStyle(int underlineStyle)Sets the underline style of the comment text. Possible values are available inFontSettings
class.- Parameters:
underlineStyle
- underline style of the comment text- See Also:
getUnderlineStyle()
-
IsStrikethrough
public bool IsStrikethrough()Returns the strikethrough setting of the comment.- Returns:
- the strikethrough setting of the comment
- See Also:
setStrikethrough(bool)
-
setStrikethrough
public void setStrikethrough(bool isStrikethrough)Sets the strikethrough option of the comment.- Parameters:
isStrikethrough
- the strikethrough option of the comment- See Also:
IsStrikethrough()
-
IsSuperscript
public bool IsSuperscript()Returns the superscript setting of the comment.- Returns:
- the superscript setting of the comment
- See Also:
setSuperscript(bool)
-
setSuperscript
public void setSuperscript(bool isSuperscript)Sets the superscript option of the comment.- Parameters:
isSuperscript
- the superscript option of the comment- See Also:
IsSuperscript()
-
IsSubscript
public bool IsSubscript()Returns the subscript setting of the comment.- Returns:
- the subscript setting of the comment
- See Also:
setSubscript(bool)
-
setSubscript
public void setSubscript(bool isSubscript)Sets the subscript option of the comment.- Parameters:
isSubscript
- the subscript option of the comment- See Also:
IsSubscript()
-
Clone
Creates and returns a copy of this object.- Returns:
- a clone of this instance.
-