TextObject.ApplyFont 방법
System.Drawing.Font 개체에 대한 변경 내용을 적용합니다.
[Visual Basic]
Public Overrideable Sub ApplyFont( _
ByVal value As System.Drawing.Font _
)
[C#]
public virtual void ApplyFont(
System.Drawing.Font value
);
매개 변수
- value
TextObject의 글꼴 설정을 포함합니다.
예제
다음 예제는 TextObject의 글꼴 및 색을 설정합니다. 메서드가 ReportObjects 컬렉션에서 이름을 기준으로 ReportObject를 가져온 다음 TextObject로 캐스팅합니다. 그리고 글꼴 대화 상자의 설정을 TextObject에 적용한 다음 TextObject의 색을 파란색으로 설정합니다.
[VJ#]
private void setFont(String reportObjectName)
{
TextObject text;
FontDialog fieldFont = new FontDialog();
try
{
text = (TextObject)Report.get_ReportDefinition()
.get_ReportObjects().get_Item(reportObjectName);
}
catch (Exception e)
{
return;
}
if ( fieldFont.ShowDialog() == DialogResult.OK )
{
text.ApplyFont( fieldFont.get_Font() );
text.set_Color( Color.get_Blue() );
}
}
[Visual Basic]
Public Sub SetFont(ByVal reportObjectName As String)
Dim text As TextObject
Dim fieldFont As New FontDialog()
If TypeOf _
(Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)) Is TextObject Then
text = _
Report.ReportDefinition.ReportObjects. _
Item(reportObjectName)
If fieldFont.ShowDialog() = DialogResult.OK Then
text.ApplyFont(fieldFont.Font)
text.Color = Color.Blue
End If
End If
[C#]
private void SetFont(string reportObjectName)
{
TextObject text;
FontDialog fieldFont = new FontDialog();
text = Report.ReportDefinition.ReportObjects[reportObjectName]
as TextObject;
if (text!= null)
{
if (fieldFont.ShowDialog() == DialogResult.OK)
{
text.ApplyFont(fieldFont.Font);
text.Color = Color.Blue;
}
}
}
요구 사항
네임스페이스 CrystalDecisions.CrystalReports.Engine
어셈블리 CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)
참고 항목
TextObject 클래스 | TextObject 멤버 | CrystalDecisions.CrystalReports.Engine 네임스페이스
©2005 Business Objects SA All rights reserved.
Business Objects SA http://www.businessobjects.com/ 지원 서비스 http://korea.businessobjects.com/services/ |