This question is locked. New answers and comments are not allowed.
Hi,
I'm experimenting with using the richTextBox as a canvas for an applicaiton. The user will add controls like charts, grids etc at runtime and then position them on the page using the mouse.
I've written some code, using your examples, to add a chart to the canvas at load time. How would I be able to allow the user to move this element on the page at runtime?
Sample code:
I'm experimenting with using the richTextBox as a canvas for an applicaiton. The user will add controls like charts, grids etc at runtime and then position them on the page using the mouse.
I've written some code, using your examples, to add a chart to the canvas at load time. How would I be able to allow the user to move this element on the page at runtime?
Sample code:
public
partial
class
MainPage : UserControl
{
public
MainPage()
{
InitializeComponent();
this
.radRichTextBox1.IsReadOnly =
true
;
RadDocument doc =
new
RadDocument();
doc.LayoutMode = DocumentLayoutMode.Paged;
doc.DefaultPageLayoutSettings =
new
PageLayoutSettings();
doc.DefaultPageLayoutSettings.Height = 600;
doc.DefaultPageLayoutSettings.Width = 500;
Section section =
new
Section();
doc.Sections.Add(section);
Paragraph paragraph =
new
Paragraph();
section.Paragraphs.Add(paragraph);
Span span =
new
Span(
"Some Text before..."
);
paragraph.Inlines.Add(span);
Button button =
new
Button();
button.Content =
"Test Button"
;
button.Width = 100;
button.Height = 50;
button.Click +=
(s, a) =>
{
MessageBox.Show(
"Your button was just clicked!"
);
};
RadChart radChart1 =
new
RadChart();
radChart1.Width = 200;
radChart1.Height = 200;
InlineUIContainer container =
new
InlineUIContainer();
container.UiElement = radChart1;
container.Width = radChart1.Width;
container.Height = radChart1.Height;
paragraph.Inlines.Add(container);
Span span2 =
new
Span(
"Some Text after..."
);
paragraph.Inlines.Add(span2);
this
.radRichTextBox1.Document = doc;
}
}