FlowDocument.Foreground Propriété
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Obtient ou définit le Brush à appliquer au contenu textuel de FlowDocument.
public:
property System::Windows::Media::Brush ^ Foreground { System::Windows::Media::Brush ^ get(); void set(System::Windows::Media::Brush ^ value); };
public System.Windows.Media.Brush Foreground { get; set; }
member this.Foreground : System.Windows.Media.Brush with get, set
Public Property Foreground As Brush
Valeur de propriété
Pinceau à appliquer au contenu de texte. La valeur par défaut est Black.
Exemples
L’exemple suivant montre comment définir l’attribut Foreground d’un FlowDocument élément.
<FlowDocumentReader>
<FlowDocument
Background="IndianRed"
Foreground="NavajoWhite"
>
<Paragraph>
This FlowDocument will have a background color of Indian red, with the text
colored Navajo white. Any Forground or Background settings on this paragraph
would override the top-level settings for the FlowDocument.
</Paragraph>
</FlowDocument>
</FlowDocumentReader>
L’exemple suivant montre comment définir la Foreground propriété par programmation.
FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
flowDoc.Background = Brushes.IndianRed;
flowDoc.Foreground = Brushes.NavajoWhite;
Dim flowDoc As New FlowDocument(New Paragraph(New Run("A bit of text content...")))
flowDoc.Background = Brushes.IndianRed
flowDoc.Foreground = Brushes.NavajoWhite
Remarques
Pour obtenir une table de nuances qui montre les couleurs de pinceau prédéfinies disponibles, consultez Brushes.
Tous Foreground les paramètres sur les éléments enfants remplacent ce paramètre de niveau supérieur.
Informations sur les propriétés de dépendance
Champ Identificateur | ForegroundProperty |
Propriétés de métadonnées définies sur true |
AffectsRender, Inherits, SubPropertiesDoNotAffectRender |
S’applique à
Commentaires
https://aka.ms/ContentUserFeedback.
Bientôt disponible : Tout au long de 2024, nous allons supprimer progressivement GitHub Issues comme mécanisme de commentaires pour le contenu et le remplacer par un nouveau système de commentaires. Pour plus d’informations, consultezEnvoyer et afficher des commentaires pour