mirror of
https://github.com/kwsch/pk3DS.git
synced 2026-10-02 05:46:47 -05:00
Fix status text on non-threaded method calls
This commit is contained in:
@@ -724,18 +724,19 @@ internal static bool setText(int file, string[] strings)
|
||||
// Update RichTextBox
|
||||
public void updateStatus(string status, bool preBreak = true)
|
||||
{
|
||||
string newtext = ((preBreak) ? Environment.NewLine : "") + status;
|
||||
try
|
||||
{
|
||||
if (RTB_Status.InvokeRequired)
|
||||
RTB_Status.Invoke((MethodInvoker)delegate
|
||||
{
|
||||
RTB_Status.AppendText(((preBreak) ? Environment.NewLine : "") + status);
|
||||
RTB_Status.AppendText(newtext);
|
||||
RTB_Status.SelectionStart = RTB_Status.Text.Length;
|
||||
RTB_Status.ScrollToCaret();
|
||||
});
|
||||
else
|
||||
{
|
||||
RTB_Status.AppendText(status + Environment.NewLine);
|
||||
RTB_Status.AppendText(newtext);
|
||||
RTB_Status.SelectionStart = RTB_Status.Text.Length;
|
||||
RTB_Status.ScrollToCaret();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user