Click here to Skip to main content
15,905,558 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: vb.net Pin
Richard MacCutchan20-Sep-19 21:07
mveRichard MacCutchan20-Sep-19 21:07 
AnswerRe: vb.net Pin
Mycroft Holmes21-Sep-19 12:48
professionalMycroft Holmes21-Sep-19 12:48 
QuestionHow to use DataTrigger to run Storyboard? Pin
Pew_new20-Sep-19 8:00
Pew_new20-Sep-19 8:00 
QuestionWPF Pin
RajaMohammed.A19-Sep-19 2:35
RajaMohammed.A19-Sep-19 2:35 
AnswerRe: WPF Pin
Richard Deeming19-Sep-19 2:58
mveRichard Deeming19-Sep-19 2:58 
AnswerRe: WPF Pin
Mycroft Holmes19-Sep-19 13:07
professionalMycroft Holmes19-Sep-19 13:07 
QuestionWindow Not Refreshing Pin
Kevin Marois17-Sep-19 9:03
professionalKevin Marois17-Sep-19 9:03 
AnswerRe: Window Not Refreshing Pin
Richard Deeming17-Sep-19 9:34
mveRichard Deeming17-Sep-19 9:34 
GeneralRe: Window Not Refreshing Pin
Kevin Marois17-Sep-19 10:03
professionalKevin Marois17-Sep-19 10:03 
GeneralRe: Window Not Refreshing Pin
Richard Deeming18-Sep-19 0:44
mveRichard Deeming18-Sep-19 0:44 
QuestionWPF Pin
RajaMohammed.A9-Sep-19 19:20
RajaMohammed.A9-Sep-19 19:20 
AnswerRe: WPF Pin
Richard MacCutchan9-Sep-19 21:19
mveRichard MacCutchan9-Sep-19 21:19 
QuestionWPF Pin
RajaMohammed.A9-Sep-19 0:25
RajaMohammed.A9-Sep-19 0:25 
AnswerRe: WPF Pin
Gerry Schmitz9-Sep-19 3:09
mveGerry Schmitz9-Sep-19 3:09 
QuestionWPF application displays differently in Windows 7 and Windows 10 Pin
Jakob Farian Krarup18-Aug-19 23:16
Jakob Farian Krarup18-Aug-19 23:16 
AnswerRe: WPF application displays differently in Windows 7 and Windows 10 Pin
jimmson21-Aug-19 3:49
jimmson21-Aug-19 3:49 
GeneralRe: WPF application displays differently in Windows 7 and Windows 10 Pin
Jakob Farian Krarup25-Aug-19 22:44
Jakob Farian Krarup25-Aug-19 22:44 
GeneralRe: WPF application displays differently in Windows 7 and Windows 10 Pin
jimmson27-Aug-19 21:53
jimmson27-Aug-19 21:53 
GeneralRe: WPF application displays differently in Windows 7 and Windows 10 Pin
Jakob Farian Krarup28-Aug-19 1:25
Jakob Farian Krarup28-Aug-19 1:25 
AnswerRe: WPF application displays differently in Windows 7 and Windows 10 Pin
Gerry Schmitz28-Aug-19 3:10
mveGerry Schmitz28-Aug-19 3:10 
GeneralRe: WPF application displays differently in Windows 7 and Windows 10 Pin
Jakob Farian Krarup28-Aug-19 22:31
Jakob Farian Krarup28-Aug-19 22:31 
QuestionWPF and Windows Forms at same time. Pin
michaelbarb15-Aug-19 5:12
michaelbarb15-Aug-19 5:12 
AnswerRe: WPF and Windows Forms at same time. Pin
Pete O'Hanlon15-Aug-19 5:39
mvePete O'Hanlon15-Aug-19 5:39 
GeneralRe: WPF and Windows Forms at same time. Pin
michaelbarb15-Aug-19 6:15
michaelbarb15-Aug-19 6:15 
QuestionEnregistrer en RTF un RichTextBox / Save RTF RichTextBox Pin
dctc333-Aug-19 23:00
dctc333-Aug-19 23:00 
bonjour,
J'ai un RichTextBox dans le quel il y a un FlowDocument

je crée un tableau par code

le tableau s'affiche correctement
je le sauvegarde en RTF .
je perds les mises en forme
seul le Background est bon

Merci de votre réponse

un bout du code


Google Translate:
Hello,
I have a RichTextBox in which there is a FlowDocument

I create a table by code

the table is displayed correctly
I save it in RTF.
I lose the formatting
only the Background is good

Thank you for your reply

a piece of code


C#
private void button2_Click_1(object sender, RoutedEventArgs e)
        {
          
             Table T = new Table();
            
            myFlowDoc.Blocks.Add(T);
            T.CellSpacing = 1;
        
          
            for (int x = 0;x<5;x++) { T.Columns.Add(new TableColumn()); }
            T.Columns[0].Background = Brushes.Beige;
            T.Columns[0].Width = new GridLength(200);
            T.Columns[1].Width = new GridLength(150);
            T.Columns[2].Width = new GridLength(60);
            T.Columns[3].Width = new GridLength(100);
            T.Columns[4].Width = new GridLength(100);


            T.BorderThickness = new Thickness(1);
            T.BorderBrush = Brushes.Red;
           

            T.RowGroups.Add(new TableRowGroup());
            T.RowGroups[0].Rows.Add(new TableRow());  // ajout titre

            TableRow currentRow = T.RowGroups[0].Rows[0];
            currentRow.FontWeight = FontWeights.Bold;

            currentRow.Background = Brushes.Silver;    /// ok
            
            currentRow.FontSize = 20;
 

            TableCell TC = new TableCell();
           
            currentRow.Cells.Add(TC);
            TC.TextAlignment = TextAlignment.Center;
            myParagraph = new Paragraph(new Run("Résultat des mesures "));
       

            TC.Blocks.Add(myParagraph);

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.