






















^XA ^CW1,E:HANS.TTF /* 加载HANS.TTF字体 */ ^SEE::GB18030.DAT /* 应用GB18030编码 */ ^CI28 /* 启用Unicode支持 */ ^LL350^PW700 /* 设置标签尺寸 */ ^LH60,20 /* 标签起始坐标:向左偏移30点 */ ^FO0,0^GB600,280,2^FS /* 表格外边框 */ /* 列分隔线 */ ^FO150,0^GB0,280,2^FS /* 第一列与第二列分隔线 */ ^FO360,0^GB0,280,2^FS /* 第二列与第三列分隔线 */ /* 前两列行分隔线(行高35,固定) */ ^FO0,35^GB360,0,2^FS /* 第1行分隔线 */ ^FO0,70^GB360,0,2^FS /* 第2行分隔线 */ ^FO0,105^GB360,0,2^FS /* 第3行分隔线 */ ^FO0,140^GB360,0,2^FS /* 第4行分隔线 */ ^FO0,175^GB360,0,2^FS /* 第5行分隔线 */ ^FO0,210^GB360,0,2^FS /* 第6行分隔线 */ ^FO0,245^GB360,0,2^FS /* 第7行分隔线 */ ^FO300,35^GB300,0,2^FS /* 第三列第1行分隔线 */ /* 第一列内容 */ ^FO10,16^A1N,16,16^CI28^FD項目^FS /* 第1行标题 */ ^FO10,51^A1N,16,16^CI28^FD供应商ID^FS /* 第2行内容 */ ^FO10,86^A1N,16,16^CI28^FD品番^FS /* 第3行内容 */ ^FO10,121^A1N,16,16^CI28^FDロート^FS /* 第4行内容 */ ^FO10,156^A1N,16,16^CI28^FD数量^FS /* 第5行内容 */ ^FO10,191^A1N,16,16^CI28^FD製造日^FS /* 第6行内容 */ ^FO10,226^A1N,16,16^CI28^FD品質保証日^FS /* 第7行内容 */ ^FO10,261^A1N,16,16^CI28^FD環境対象^FS /* 第8行内容 */ /* 第二列内容 */ ^FO160,16^A1N,16,16^CI28^FD内容样例^FS /* 第1行标题 */ ^FO160,51^A1N,16,16^CI28^FDVERDOR01^FS /* 第2行内容 */ ^FO160,86^A1N,16,16^CI28^FDAIWAX-ZP^FS /* 第3行内容 */ ^FO160,121^A1N,16,16^CI28^FDL240819-1^FS /* 第4行内容 */ ^FO160,156^A1N,16,16^CI28^FD20^FS /* 第5行内容 */ ^FO160,191^A1N,16,16^CI28^FD240819^FS /* 第6行内容 */ ^FO160,226^A1N,16,16^CI28^FD250818^FS /* 第7行内容 */ ^FO160,261^A1N,16,16^CI28^FDN^FS /* 第8行内容 */ /* 第三列内容(第一行改为Code 128条码) */ ^FO380,50^BQN,2,8^CI28^FDQA,https://example.com^FS /* 二维码 */ ^XZ
<Window x:Class="WpfApp.Windows.ProgressWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="现代进度条" Height="220" Width="420" WindowStartupLocation="CenterScreen" Background="#F5F6FA" FontFamily="Segoe UI" ResizeMode="NoResize"> <Window.Resources> <!-- 自定义圆角渐变进度条样式 --> <Style x:Key="ModernProgressBar" TargetType="ProgressBar"> <Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ProgressBar"> <Grid x:Name="Root" Height="20" ClipToBounds="True" SnapsToDevicePixels="True"> <!-- 背景条 --> <Border x:Name="PART_Track" Background="#E0E0E0" CornerRadius="10" Height="20" /> <!-- 进度条指示 --> <Border x:Name="PART_Indicator" Height="20" HorizontalAlignment="Left" CornerRadius="10" Width="0"> <Border.Background> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Color="#0078D7" Offset="0" /> <GradientStop Color="#4FC3F7" Offset="1" /> </LinearGradientBrush> </Border.Background> </Border> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Margin="20" Width="360"> <TextBlock Text="处理中,请稍候..." FontSize="18" FontWeight="SemiBold" Foreground="#333" Margin="0,0,0,20" HorizontalAlignment="Center" /> <!-- 进度条 --> <ProgressBar x:Name="progressBar" Height="20" Minimum="0" Maximum="100" Value="0" Style="{StaticResource ModernProgressBar}" /> <TextBlock x:Name="progressText" FontSize="14" Foreground="#555" HorizontalAlignment="Center" Margin="0,10,0,0" Text="0%" /> <Button Content="开始处理" Width="120" Height="36" Background="#0078D7" Foreground="White" FontWeight="Bold" BorderThickness="0" Cursor="Hand" Margin="0,20,0,0" Click="StartProcessing_Click" HorizontalAlignment="Center" /> </StackPanel> </Grid> </Window>
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Shapes; namespace WpfApp.Windows { /// <summary> /// ProgressWindow.xaml 的交互逻辑 /// </summary> public partial class ProgressWindow : Window { public ProgressWindow() { InitializeComponent(); } private async void StartProcessing_Click(object sender, RoutedEventArgs e) { progressBar.Value = 0; for (int i = 0; i <= 100; i++) { progressBar.Value = i; progressText.Text = $"{i}%"; await Task.Delay(20); } MessageBox.Show("处理完成!", "提示", MessageBoxButton.OK, MessageBoxImage.Information); } } }
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。