像芥末堆做内容的网站,天津免费做网站,如何做电影网站才不侵权,网站开发分页代码概述HandyControl是一款免费开源的WPF控件库#xff0c;Github可以获取到源代码#xff0c;相关的示例代码也在github上能获取到#xff0c;但是没有详细的中文说明文档#xff0c;对于新手而言使用起来还是会有一些困扰#xff0c;网上也很难搜到相关的用法示例#xff…概述HandyControl是一款免费开源的WPF控件库Github可以获取到源代码相关的示例代码也在github上能获取到但是没有详细的中文说明文档对于新手而言使用起来还是会有一些困扰网上也很难搜到相关的用法示例所以本节就对它常用的一些控件举例说明下。首先还是先在nuget上引用HC的库然后在前台XAML引用xmlns:hchttps://handyorg.github.io/handycontrol在App.xaml中引用HC的皮肤和主题Application.ResourcesResourceDictionaryResourceDictionary.MergedDictionariesResourceDictionary Sourcepack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml/ResourceDictionary Sourcepack://application:,,,/HandyControl;component/Themes/Theme.xaml//ResourceDictionary.MergedDictionaries/ResourceDictionary/Application.ResourcesMessageBox用法举例①对话框MessageBox.Show(检测到有版本更新是否更新, 标题, MessageBoxButton.YesNo, MessageBoxImage.Question);②提示框MessageBox.Show(当前选中了: listbox.SelectedItem, 标题, MessageBoxButton.OK, MessageBoxImage.Information);③错误框MessageBox.Show(当前选中了: listbox.SelectedItem, 标题, MessageBoxButton.OK, MessageBoxImage.Error);总共有9个枚举量可供选择分别如下//// 摘要:// Specifies the icon that is displayed by a message box.public enum MessageBoxImage{//// 摘要:// The message box contains no symbols.None 0,//// 摘要:// The message box contains a symbol consisting of white X in a circle with a red// background.Error 16,//// 摘要:// The message box contains a symbol consisting of a white X in a circle with a// red background.Hand 16,//// 摘要:// The message box contains a symbol consisting of white X in a circle with a red// background.Stop 16,//// 摘要:// The message box contains a symbol consisting of a question mark in a circle.// The question mark message icon is no longer recommended because it does not clearly// represent a specific type of message and because the phrasing of a message as// a question could apply to any message type. In addition, users can confuse the// question mark symbol with a help information symbol. Therefore, do not use this// question mark symbol in your message boxes. The system continues to support its// inclusion only for backward compatibility.Question 32,//// 摘要:// The message box contains a symbol consisting of an exclamation point in a triangle// with a yellow background.Exclamation 48,//// 摘要:// The message box contains a symbol consisting of an exclamation point in a triangle// with a yellow background.Warning 48,//// 摘要:// The message box contains a symbol consisting of a lowercase letter i in a circle.Asterisk 64,//// 摘要:// The message box contains a symbol consisting of a lowercase letter i in a circle.Information 64}Button用法举例①带图标的buttonButton Height48 Width160 Margin3 NametestBtnBackground{DynamicResource PrimaryBrush}hc:BackgroundSwitchElement.MouseHoverBackground{DynamicResource MouseHoverBrush} hc:BackgroundSwitchElement.MouseDownBackground{DynamicResource MouseDownBrush}Button.ContentGridGrid.ColumnDefinitionsColumnDefinition Widthauto/ColumnDefinition//Grid.ColumnDefinitionsImage Sourcepack://application:,,,/Images/icon.ico/Label Grid.Column1 ContentCustom Button BorderThickness0 BackgroundTransparent Foreground{DynamicResource TextIconBrush}//Grid/Button.Content/Button②RepeatButton用法RepeatButton Height48 Width160 ContentRepeat Button Margin3 Delay500 Style{StaticResource RepeatButtonPrimary} Background{DynamicResource PrimaryBrush} Foreground{DynamicResource TextIconBrush} hc:BorderElement.CornerRadius5 NameRepeatButton_Click/③带有日历图表的buttonButton Margin5 Style{StaticResource ButtonPrimary} hc:IconElement.Geometry{StaticResource CalendarGeometry}/Button IsEnabledFalse Margin5 Style{StaticResource ButtonPrimary} hc:IconElement.Geometry{StaticResource CalendarGeometry}/④左旋转又旋转图表buttonButton Margin5 Style{StaticResource ButtonSuccess} hc:IconElement.Geometry{StaticResource RotateLeftGeometry}/Button IsEnabledFalse Margin5 Style{StaticResource ButtonSuccess} hc:IconElement.Geometry{StaticResource RotateLeftGeometry}/⑤带左右箭头图标的buttonButton Margin5 Style{StaticResource ButtonWarning} hc:IconElement.Geometry{StaticResource LeftGeometry}/Button Margin5 Style{StaticResource ButtonWarning} hc:IconElement.Geometry{StaticResource RightGeometry}/⑥ToggleButton 按钮ToggleButton IsCheckedTrue Margin5,8 HorizontalAlignmentCenter Style{StaticResource ToggleButtonSwitch} hc:VisualElement.HighlightBrush{DynamicResource DangerBrush}/ToggleButton IsEnabledFalse IsCheckedTrue HorizontalAlignmentCenter Margin5,4 Style{StaticResource ToggleButtonSwitch}/Lable用法举例Label ContentDangerBrush Style{StaticResource LabelDanger}/Label ContentDarkPrimaryBrush Background{DynamicResource DarkPrimaryBrush} ForegroundWhite BorderThickness0/Slider用法举例Slider Width400 IsSnapToTickEnabledTrue Value8/Slider Width400 IsSnapToTickEnabledTrue TickFrequency5 Maximum100 TickPlacementTopLeft Value10 IsSelectionRangeEnabledTrue SelectionStart10 SelectionEnd80/Slider Width400 hc:TipElement.VisibilityVisible hc:TipElement.PlacementTop IsSnapToTickEnabledTrue Maximum100 Value60 TickFrequency10 TickPlacementBottomRight/Slider Width400 hc:TipElement.VisibilityVisible hc:TipElement.PlacementBottom hc:TipElement.StringFormat#0.00 Value5 TickPlacementBoth/TextBox用法举例TextBox Margin0,0,0,32 hc:InfoElement.TitleWidth70 hc:InfoElement.PlaceholderNecessary hc:InfoElement.TitlePlacementLeft hc:InfoElement.TitleLeft title hc:InfoElement.NecessaryTrue Style{StaticResource TextBoxExtend} NameTextContent/组合框ComboBox用法举例ComboBox IsEditableTrue Width380 hc:InfoElement.TitleWidth140 hc:InfoElement.TitlePlacementLeft hc:InfoElement.Titlecombox hc:InfoElement.NecessaryTrue Style{StaticResource ComboBoxExtend} Margin0,16,0,0ComboBoxItem张三/ComboBoxItemComboBoxItem李四/ComboBoxItemComboBoxItem王五/ComboBoxItem/ComboBox还有很多基本控件限于篇幅本节就讲到这里要想深入学习了解还是得下载源代码去探索调试.源码下载链接https://pan.baidu.com/s/1Rdx43-8Aa21gl_YPsh6ncg 提取码6666本文参考链接https://github.com/HandyOrg/HandyControl