G
Guest
I'm new to CF and Microsoft programming in general -- been doing java.
I'm porting a simple console-based output-only program to the Pocket PC.
There is no console available for me to output text to, it seems
(System.out in java-talk).
So I'm using a TextBox as my output "console" and have created a
TextWriter that writes to it (see below). The problem is that the
display is slower and flickery. I suspect that's because I'm appending
to the Text propert whenever a new line of info is printed. Is there
some other way to append text to the end of a TextBox but avoid that
flicker?
Thanks!
class TextBoxWriter: System.IO.TextWriter
{
private TextBox box;
// Constructor
public TextBoxWriter(TextBox textBox)
{
box = textBox;
}
// Implement Encoding() method from TextWriter
public override Encoding Encoding
{
get
{
return(Encoding.Unicode);
}
}
public override string NewLine
{
get
{
return "\r\n";
}
}
public override void Write(string message)
{
box.Text += message;
}
public override void WriteLine(string message)
{
box.Text += message + NewLine;
}
}
I'm porting a simple console-based output-only program to the Pocket PC.
There is no console available for me to output text to, it seems
(System.out in java-talk).
So I'm using a TextBox as my output "console" and have created a
TextWriter that writes to it (see below). The problem is that the
display is slower and flickery. I suspect that's because I'm appending
to the Text propert whenever a new line of info is printed. Is there
some other way to append text to the end of a TextBox but avoid that
flicker?
Thanks!
class TextBoxWriter: System.IO.TextWriter
{
private TextBox box;
// Constructor
public TextBoxWriter(TextBox textBox)
{
box = textBox;
}
// Implement Encoding() method from TextWriter
public override Encoding Encoding
{
get
{
return(Encoding.Unicode);
}
}
public override string NewLine
{
get
{
return "\r\n";
}
}
public override void Write(string message)
{
box.Text += message;
}
public override void WriteLine(string message)
{
box.Text += message + NewLine;
}
}