Display text using labels -- very slow
-
I'm working on a bible project. Part of it is to display bible verses on screen. Given that the bible text are in different formats (some are italics, some are in red, ...). I tried using labels to display them. But if one chapter has 80 verses, I would have to create at least 80 labels. This is very slow - could take 15-20 seconds to display. Apart from using labels, is there any other efficient way to handle text display? Thanks!!
-
I'm working on a bible project. Part of it is to display bible verses on screen. Given that the bible text are in different formats (some are italics, some are in red, ...). I tried using labels to display them. But if one chapter has 80 verses, I would have to create at least 80 labels. This is very slow - could take 15-20 seconds to display. Apart from using labels, is there any other efficient way to handle text display? Thanks!!
Graphics.DrawString()
Here is something to get you started:class CustomDrawControl : Control
{
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawString("blah blah", Font, Brushes.Red, e.ClipRectangle);
}
}**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
-
Graphics.DrawString()
Here is something to get you started:class CustomDrawControl : Control
{
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawString("blah blah", Font, Brushes.Red, e.ClipRectangle);
}
}**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
Thanks! Since I'm new to C#, can you be more specific? Do I use graphics instead for each text in those labels I created?
-
I'm working on a bible project. Part of it is to display bible verses on screen. Given that the bible text are in different formats (some are italics, some are in red, ...). I tried using labels to display them. But if one chapter has 80 verses, I would have to create at least 80 labels. This is very slow - could take 15-20 seconds to display. Apart from using labels, is there any other efficient way to handle text display? Thanks!!
You could use the RichTextBox[^] control. It supports formatting.
-
Graphics.DrawString()
Here is something to get you started:class CustomDrawControl : Control
{
protected override void OnPaint(PaintEventArgs e)
{
e.Graphics.DrawString("blah blah", Font, Brushes.Red, e.ClipRectangle);
}
}**
How xacc.ide transforms text to colored words on the screen
Intel PentuimM (aka Centrino) undervolting**
I have taken a look at it. But how can the drawstring be changed? How is the "tabPage1.paint += new System.Windows.Forms.PaintEventHandler(tabPage1_paint)" triggered? -- modified at 3:58 Tuesday 30th May, 2006
-
You could use the RichTextBox[^] control. It supports formatting.
But would RichTextBox control be as slow as label control? Someone suggested using paint control. Do you know how to do that?
-
But would RichTextBox control be as slow as label control? Someone suggested using paint control. Do you know how to do that?
-
The rtb should be much faster than dynamically creating a mess of labels. Paint isn't a control, it's an event for your form. It's more flexible, but if you're a beginner the price in increased effort needed to use is probably not worth it.
I managed to displayed text by using graphic object. g = tabPage1.CreateGraphics(); g.DrawString(text, fnt, brsh, x, y); g.Dispose(); I used labels before and the tabPage was scrollable (tabPage.AutoScroll = true). But now it is not scrollable any more and thus those text at the bottom are missing from the tabPage. Do you know why? -- modified at 11:48 Tuesday 30th May, 2006