Partager via


TextObject.ApplyFont Méthode

Applique les modifications apportées à l'objet System.Drawing.Font.

[Visual Basic]

Public Overrideable Sub ApplyFont( _
   ByVal value As System.Drawing.Font _
)

[C#]

public virtual void ApplyFont(
   System.Drawing.Font value
);

Paramètres

  • value
    Contient les paramètres de police de TextObject.

Exemple

[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;
            }
         }
      }
      

Configuration requise

Espace de noms CrystalDecisions.CrystalReports.Engine

Assembly CrystalDecisions.CrystalReports.Engine (CrystalDecisions.CrystalReports.Engine.dll)

Voir aussi

TextObject Classe | TextObject Membres | CrystalDecisions.CrystalReports.Engine Espace de noms

**

©2005 Business Objects SA. Tous droits réservés.

Business Objects SA.
http://www.france.businessobjects.com/
Services de support
http://www.businessobjects.com/support/