Skip to content

Commit 787937d

Browse files
fix scroll to end
1 parent 91ec6ac commit 787937d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

functions/private/Invoke-WinUtilISO.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function Write-Win11ISOLog {
1414
} else {
1515
$sync["WPFWin11ISOStatusLog"].Text += "`n[$timestamp] $Message"
1616
}
17+
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
1718
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
1819
})
1920
}
@@ -249,6 +250,7 @@ function Invoke-WinUtilISOModify {
249250
$ts = (Get-Date).ToString("HH:mm:ss")
250251
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
251252
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
253+
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
252254
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
253255
})
254256
}
@@ -275,6 +277,7 @@ function Invoke-WinUtilISOModify {
275277
$sync["Form"].add_SizeChanged({
276278
if ($sync["Win11ISOLogExpanded"]) {
277279
$sync["WPFWin11ISOStatusLog"].Height = [Math]::Max(400, $sync["Form"].ActualHeight - 100)
280+
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
278281
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
279282
}
280283
})
@@ -665,6 +668,7 @@ function Invoke-WinUtilISOWriteUSB {
665668
$ts = (Get-Date).ToString("HH:mm:ss")
666669
$sync["WPFWin11ISOStatusLog"].Dispatcher.Invoke([action]{
667670
$sync["WPFWin11ISOStatusLog"].Text += "`n[$ts] $msg"
671+
$sync["WPFWin11ISOStatusLog"].CaretIndex = $sync["WPFWin11ISOStatusLog"].Text.Length
668672
$sync["WPFWin11ISOStatusLog"].ScrollToEnd()
669673
})
670674
}

0 commit comments

Comments
 (0)