1 Star 0 Fork 0

Joke_Study/电子天平应用程序

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
MainWindow.xaml 6.96 KB
一键复制 编辑 原始数据 按行查看 历史
LuckyJoke 提交于 2024-08-28 16:22 . first commit
<Window x:Class="BalanceAdapter.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:local="clr-namespace:BalanceAdapter"
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Loaded="Window_Loaded"
Icon="/Images/电子称.png"
Background="White"
Title="电子天平适配器" Height="450" Width="700"
Closing="Window_Closing"
ResizeMode="CanMinimize">
<Window.Resources>
<ResourceDictionary>
<WindowChrome x:Key="WindowChromeKey" GlassFrameThickness="-1">
<WindowChrome.ResizeBorderThickness>
<Thickness>5</Thickness>
</WindowChrome.ResizeBorderThickness>
<WindowChrome.CaptionHeight>0</WindowChrome.CaptionHeight>
</WindowChrome>
<SolidColorBrush x:Key="MainColor" Color="#FF5722"/>
<SolidColorBrush x:Key="FontColor" Color="#1A3b6c"/>
<SolidColorBrush x:Key="HoverColor" Color="#FF5722"/>
<SolidColorBrush x:Key="AlertColor" Color="#FF5722"/>
<SolidColorBrush x:Key="BlackColor" Color="#393D49"/>
<SolidColorBrush x:Key="RedColor" Color="#FF5722"/>
<SolidColorBrush x:Key="GrayColor" Color="#c2c2c2"/>
<SolidColorBrush x:Key="BlueColor" Color="#1E9FFF"/>
<SolidColorBrush x:Key="Tech1" Color="#081934"/>
<SolidColorBrush x:Key="BlackBlue" Color="#1A3b6c"/>
<SolidColorBrush x:Key="WhiteColor" Color="#FFFFFF"/>
</ResourceDictionary>
</Window.Resources>
<Grid Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="20"></RowDefinition>
</Grid.RowDefinitions>
<Grid Grid.Row="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<GroupBox Grid.Column="0" Header="设备信息" Margin="5"
Style="{StaticResource InputElementBaseStyle}">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="50"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<ComboBox Grid.Row="0" x:Name="cb_device" IsEditable="False" hc:InfoElement.Title="串口号:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0"/>
<ComboBox Grid.Row="1" x:Name="cb_rate" IsEditable="False" hc:InfoElement.Title="波特率:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">9600</ComboBoxItem>
<ComboBoxItem>2400</ComboBoxItem>
<ComboBoxItem>4800</ComboBoxItem>
</ComboBox>
<ComboBox Grid.Row="2" x:Name="cb_databit" IsEditable="False" hc:InfoElement.Title="数据位:" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">8</ComboBoxItem>
<ComboBoxItem >7</ComboBoxItem>
<ComboBoxItem >6</ComboBoxItem>
<ComboBoxItem >5</ComboBoxItem>
</ComboBox>
<!--<ComboBox Grid.Row="3" x:Name="cb_stopbit" IsEditable="False" hc:InfoElement.Title="停止位" hc:InfoElement.TitlePlacement="Left" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0">
<ComboBoxItem IsSelected="True">1</ComboBoxItem>
<ComboBoxItem >1.5</ComboBoxItem>
<ComboBoxItem >2</ComboBoxItem>
</ComboBox>-->
</Grid>
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="0" FontSize="14" x:Name="txt_state" HorizontalAlignment="Left" Text="设备未连接" Style="{StaticResource TextBlockDefaultDanger}"/>
<StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
<Button x:Name="btn_connect" Click="btn_connect_Click" Width="80" Content="连接" Margin="5" Style="{StaticResource ButtonSuccess}"/>
<Button x:Name="btn_dis_connect" Click="btn_dis_connect_Click" Width="80" Content="断开连接" Margin="5" Style="{StaticResource ButtonDanger}" Visibility="Collapsed"/>
<Button x:Name="btn_test" Click="btn_test_Click" Width="80" Content="测试" Margin="5" Style="{StaticResource ButtonDanger}" Visibility="Collapsed"/>
</StackPanel>
</Grid>
</Grid>
</GroupBox>
<GroupBox Grid.Column="1" Header="称重结果" Margin="5"
Style="{StaticResource InputElementBaseStyle}">
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Margin="10">
<TextBlock x:Name="txt_heavy" HorizontalAlignment="Left"
Text="" FontSize="40" TextWrapping="Wrap"
Style="{StaticResource TextBlockTitleBold}"/>
</StackPanel>
</GroupBox>
</Grid>
<TextBlock Grid.Row="1" VerticalAlignment="Center" Text="版权所有:北京际威试验仪器有限公司" HorizontalAlignment="Center"></TextBlock>
<hc:NotifyIcon Name="notifyIcon"
HorizontalAlignment="Left" Grid.Row="1"
VerticalAlignment="Top" Width="100" Icon="/Images/电子称.ico"
Click="notifyIcon_Click"
Text="际威电子天平转换"/>
</Grid>
</Window>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/joke_study/BalanceAdaper.git
git@gitee.com:joke_study/BalanceAdaper.git
joke_study
BalanceAdaper
电子天平应用程序
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385