plane26
plane26
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
<:blushie_cat:1028655887323242546> ❤️
8 replies
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
Thank you
8 replies
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
Oh
8 replies
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
it works.. im just feeling bad xddd cause it looks simple xd
8 replies
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
this is the code
8 replies
CC#
Created by plane26 on 6/25/2023 in #help
✅ Is it bad to ask chatGPT about simple things?
// Get the current caret position in the RichTextBox
TextPointer caretPosition = rtb.CaretPosition;

// Create a new Run with the typed text
Run run = new Run(e.Text);

// Apply formatting (bold) to the Run
run.FontWeight = FontWeights.Bold;

// Create a new TextRange from the caret position to the next insertion position
TextRange insertionRange = new TextRange(caretPosition, caretPosition);

// Set the text of the insertion range to the typed text
insertionRange.Text = e.Text;

// Apply formatting (bold) to the inserted text
insertionRange.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);

// Move the caret position to the end of the inserted text
rtb.CaretPosition = insertionRange.End;

// Mark the event as handled to prevent the default insertion of the typed text
e.Handled = true;
// Get the current caret position in the RichTextBox
TextPointer caretPosition = rtb.CaretPosition;

// Create a new Run with the typed text
Run run = new Run(e.Text);

// Apply formatting (bold) to the Run
run.FontWeight = FontWeights.Bold;

// Create a new TextRange from the caret position to the next insertion position
TextRange insertionRange = new TextRange(caretPosition, caretPosition);

// Set the text of the insertion range to the typed text
insertionRange.Text = e.Text;

// Apply formatting (bold) to the inserted text
insertionRange.ApplyPropertyValue(TextElement.FontWeightProperty, FontWeights.Bold);

// Move the caret position to the end of the inserted text
rtb.CaretPosition = insertionRange.End;

// Mark the event as handled to prevent the default insertion of the typed text
e.Handled = true;
8 replies
CC#
Created by plane26 on 6/24/2023 in #help
Wpf RichTextBox styling
pepecat
4 replies
CC#
Created by plane26 on 6/24/2023 in #help
Wpf RichTextBox styling
Or maybe im dumb idk
4 replies
CC#
Created by plane26 on 6/24/2023 in #help
Wpf RichTextBox styling
I couldnt find anything on internet
4 replies