众所周知,Silverlight将界面设计与代码实现分开。即便如此,如果不能灵活地运用样式Style,开发的效率依然会比较低。比如,针对类似的TextBlock,你可能需要反复地在设计器xaml中复制粘贴很多行设计器代码。但如果开发人员掌握了样式的使用,可以一次设计,到处使用。

(一)获取一个控件的样式Style文件

这里以FloatableWindow控件为例

(1)打开一个继承自FloatableWindow的控件OverlapControl的设计器文件OverlapControl.xaml,在菜单栏中点击”视图->在Blend中打开“(View->Open in Blend),如下如所示

(2)打开Blend之后,在Object and Timeline视图中,右键"FloatableWindow",并选择“Edit Template->Create Empty”,创建新一个新的资源字典ResourceDictionary.xaml:

(3)假如该控件没有与任何ResourceDictionary文件关联,则需要新建一个资源字典文件ResourceDictionary:

(4)修改资源字典文件的名称,点击“确定”(OK),如此,就可以在当前目录看到创建的资源字典文件FloatableWindowStyle.xaml

此时,在OverlapControl.xaml设计器文件中,会多上几行引用的代码:

(二)调整或设置控件的样式Style文件

此时,重新再Blend中打开OverlapControl.xaml或者打开FloatableWindowStyle.xaml,可以对FloatableWindow的样式进行调整,或者设置其对应的参数:

(1)打开编辑样式资源的开关:

(2)随后,在视图区中,可以看到FloatableWindow的简单视图:

(3)选中“属性”(Properties)选项卡,可以非常方便地设置该控件的参数:

(4)当然,开发人员也可以在设计器文件中直接调整参数的值,一下代码本人调整好后的代码:

  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:windows="clr-namespace:System.Windows.Controls;assembly=FloatableWindow">
  4. <!-- Resource dictionary entries should be defined here. -->
  5. <LinearGradientBrush x:Key="HeaderBackgroundBrush" EndPoint="0,0" StartPoint="0,1">
  6. <GradientStop Offset="0.0" Color="#92bfbe"/>
  7. <GradientStop Offset="0.2" Color="#8dc5c4"/>
  8. <GradientStop Offset="0.8" Color="#8dc5c4"/>
  9. <GradientStop Offset="1.0" Color="#92bfbe"/>
  10. </LinearGradientBrush>
  11.  
  12. <SolidColorBrush x:Key="HeaderBorderBrush" Color="#ff9bb6b5" />
  13.  
  14. <Style x:Key="FloatableWindowStyle1" TargetType="windows:FloatableWindow">
  15.  
  16. <Setter Property="IsTabStop" Value="false"/>
  17. <Setter Property="TabNavigation" Value="Cycle"/>
  18. <Setter Property="HorizontalAlignment" Value="Center"/>
  19. <Setter Property="VerticalAlignment" Value="Center"/>
  20. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  21. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  22. <Setter Property="BorderThickness" Value="1"/>
  23. <Setter Property="BorderBrush">
  24. <Setter.Value>
  25. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  26. <GradientStop Color="#FFA3AEB9" Offset="0"/>
  27. <GradientStop Color="#FF8399A9" Offset="0.375"/>
  28. <GradientStop Color="#FF718597" Offset="0.375"/>
  29. <GradientStop Color="#FF617584" Offset="1"/>
  30. </LinearGradientBrush>
  31. </Setter.Value>
  32. </Setter>
  33. <Setter Property="OverlayBrush" Value="#7F000000"/>
  34. <Setter Property="OverlayOpacity" Value="1"/>
  35. <Setter Property="Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="windows:FloatableWindow">
  38. <Grid x:Name="Root">
  39. <Grid.Resources>
  40. <Style x:Key="ButtonStyle" TargetType="Button">
  41. <Setter Property="Background" Value="#FF1F3B53"/>
  42. <Setter Property="Foreground" Value="#FF000000"/>
  43. <Setter Property="Padding" Value="3"/>
  44. <Setter Property="BorderThickness" Value="1"/>
  45. <Setter Property="BorderBrush">
  46. <Setter.Value>
  47. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  48. <GradientStop Color="#FFA3AEB9" Offset="0"/>
  49. <GradientStop Color="#FF8399A9" Offset="0.375"/>
  50. <GradientStop Color="#FF718597" Offset="0.375"/>
  51. <GradientStop Color="#FF617584" Offset="1"/>
  52. </LinearGradientBrush>
  53. </Setter.Value>
  54. </Setter>
  55. <Setter Property="Template">
  56. <Setter.Value>
  57. <ControlTemplate TargetType="Button">
  58. <Grid x:Name="grid" Background="#02FFFFFF" HorizontalAlignment="Center" Height="14" VerticalAlignment="Center" Width="15">
  59. <VisualStateManager.VisualStateGroups>
  60. <VisualStateGroup x:Name="CommonStates">
  61. <VisualState x:Name="Normal"/>
  62. <VisualState x:Name="MouseOver">
  63. <Storyboard>
  64. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
  65. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  66. </ObjectAnimationUsingKeyFrames>
  67. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
  68. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  69. </ObjectAnimationUsingKeyFrames>
  70. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
  71. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  72. </ObjectAnimationUsingKeyFrames>
  73. <DoubleAnimation Duration="0" To="0.95" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
  74. </Storyboard>
  75. </VisualState>
  76. <VisualState x:Name="Pressed">
  77. <Storyboard>
  78. <DoubleAnimation Duration="0" To="0.85" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
  79. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz2">
  80. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  81. </ObjectAnimationUsingKeyFrames>
  82. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz1">
  83. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  84. </ObjectAnimationUsingKeyFrames>
  85. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="X_Fuzz0">
  86. <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
  87. </ObjectAnimationUsingKeyFrames>
  88. </Storyboard>
  89. </VisualState>
  90. <VisualState x:Name="Disabled">
  91. <Storyboard>
  92. <DoubleAnimation Duration="0" To="0.5" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="X"/>
  93. </Storyboard>
  94. </VisualState>
  95. </VisualStateGroup>
  96. </VisualStateManager.VisualStateGroups>
  97. <Path x:Name="X_Fuzz2" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#14C51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#14C51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
  98. <Path.RenderTransform>
  99. <TransformGroup>
  100. <ScaleTransform ScaleY="1.3" ScaleX="1.3"/>
  101. </TransformGroup>
  102. </Path.RenderTransform>
  103. </Path>
  104. <Path x:Name="X_Fuzz1" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#1EC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" RenderTransformOrigin="0.5,0.5" Stretch="Fill" Stroke="#1EC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9">
  105. <Path.RenderTransform>
  106. <TransformGroup>
  107. <ScaleTransform ScaleY="1.1" ScaleX="1.1"/>
  108. </TransformGroup>
  109. </Path.RenderTransform>
  110. </Path>
  111. <Path x:Name="X_Fuzz0" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFC51900" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="1" Stretch="Fill" Stroke="#FFC51900" Visibility="Collapsed" VerticalAlignment="Center" Width="9"/>
  112. <Path x:Name="X" Data="F1 M 6.742676,3.852539 L 9.110840,1.559570 L 8.910645,0.500000 L 6.838379,0.500000 L 4.902832,2.435547 L 2.967285,0.500000 L 0.895020,0.500000 L 0.694824,1.559570 L 3.062988,3.852539 L 0.527832,6.351563 L 0.689941,7.600586 L 2.967285,7.600586 L 4.897949,5.575195 L 6.854004,7.600586 L 9.115723,7.600586 L 9.277832,6.351563 L 6.742676,3.852539 Z" Fill="#FFFFFFFF" HorizontalAlignment="Center" Height="8" Margin="0,-1,0,0" Opacity="0.7" Stretch="Fill" VerticalAlignment="Center" Width="9">
  113. <Path.Stroke>
  114. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  115. <GradientStop Color="#FF313131" Offset="1"/>
  116. <GradientStop Color="#FF8E9092" Offset="0"/>
  117. </LinearGradientBrush>
  118. </Path.Stroke>
  119. </Path>
  120. </Grid>
  121. </ControlTemplate>
  122. </Setter.Value>
  123. </Setter>
  124. </Style>
  125. </Grid.Resources>
  126. <VisualStateManager.VisualStateGroups>
  127. <VisualStateGroup x:Name="WindowStates">
  128. <VisualState x:Name="Open">
  129. <Storyboard>
  130. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
  131. <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
  132. <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="1"/>
  133. </DoubleAnimationUsingKeyFrames>
  134. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
  135. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  136. <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
  137. <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
  138. <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
  139. <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
  140. </DoubleAnimationUsingKeyFrames>
  141. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
  142. <SplineDoubleKeyFrame KeyTime="0" Value="0"/>
  143. <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="0"/>
  144. <SplineDoubleKeyFrame KeyTime="00:00:00.4" Value="1"/>
  145. <SplineDoubleKeyFrame KeySpline="0,0,0.5,1" KeyTime="00:00:00.45" Value="1.05"/>
  146. <SplineDoubleKeyFrame KeyTime="00:00:00.55" Value="1"/>
  147. </DoubleAnimationUsingKeyFrames>
  148. </Storyboard>
  149. </VisualState>
  150. <VisualState x:Name="Closed">
  151. <Storyboard>
  152. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Overlay">
  153. <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
  154. <EasingDoubleKeyFrame KeyTime="00:00:00.3" Value="0"/>
  155. </DoubleAnimationUsingKeyFrames>
  156. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleX" Storyboard.TargetName="ContentRoot">
  157. <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
  158. <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
  159. <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
  160. </DoubleAnimationUsingKeyFrames>
  161. <DoubleAnimationUsingKeyFrames BeginTime="0" Storyboard.TargetProperty="(RenderTransform).(Children)[0].ScaleY" Storyboard.TargetName="ContentRoot">
  162. <SplineDoubleKeyFrame KeyTime="00:00:00.2" Value="1"/>
  163. <SplineDoubleKeyFrame KeyTime="00:00:00.25" Value="1.05"/>
  164. <SplineDoubleKeyFrame KeyTime="00:00:00.45" Value="0"/>
  165. </DoubleAnimationUsingKeyFrames>
  166. </Storyboard>
  167. </VisualState>
  168. </VisualStateGroup>
  169. </VisualStateManager.VisualStateGroups>
  170. <Grid x:Name="Overlay" Background="{TemplateBinding OverlayBrush}" HorizontalAlignment="Stretch" Margin="0" Opacity="{TemplateBinding OverlayOpacity}" VerticalAlignment="Top"/>
  171. <Grid x:Name="ContentRoot" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" Height="{TemplateBinding Height}" RenderTransformOrigin="0.5,0.5"
  172. VerticalAlignment="{TemplateBinding VerticalAlignment}" Width="{TemplateBinding Width}">
  173. <Grid.RenderTransform>
  174. <TransformGroup>
  175. <ScaleTransform/>
  176. <SkewTransform/>
  177. <RotateTransform/>
  178. <TranslateTransform/>
  179. </TransformGroup>
  180. </Grid.RenderTransform>
  181.  
  182. <Border BorderBrush="#14000000" BorderThickness="1" Background="#14000000" CornerRadius="2" HorizontalAlignment="Stretch" Margin="-1" VerticalAlignment="Stretch"/>
  183. <Border BorderBrush="#0F000000" BorderThickness="1" Background="#0F000000" CornerRadius="2.25" HorizontalAlignment="Stretch" Margin="-2" VerticalAlignment="Stretch"/>
  184. <Border BorderBrush="#0C000000" BorderThickness="1" Background="#0C000000" CornerRadius="2.5" HorizontalAlignment="Stretch" Margin="-3" VerticalAlignment="Stretch"/>
  185. <Border BorderBrush="#0A000000" BorderThickness="1" Background="#0A000000" CornerRadius="2.75" HorizontalAlignment="Stretch" Margin="-4" VerticalAlignment="Stretch"/>
  186.  
  187. <!--*********************************整个面板的边框***********************************-->
  188. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="#FFFFFFFF" CornerRadius="5">
  189. <Border CornerRadius="1.5" Margin="0">
  190. <Border.Background><!--面板背景色-->
  191. <!--
  192. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  193. <GradientStop Color="#FFE5E8EB" Offset="1"/>
  194. <GradientStop Color="#FFF6F8F9" Offset="0"/>
  195. </LinearGradientBrush>
  196. -->
  197. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  198. <GradientStop Offset="0" Color="#FFffffff"/>
  199. <GradientStop Offset="1.0" Color="#FFffffff"/>
  200. </LinearGradientBrush>
  201. </Border.Background>
  202. <Grid>
  203. <Grid.RowDefinitions>
  204. <RowDefinition Height="Auto"/>
  205. <RowDefinition/>
  206. </Grid.RowDefinitions>
  207.  
  208. <!--*********************************标题框……边框***********************************-->
  209. <Border x:Name="Chrome" BorderBrush="{StaticResource HeaderBorderBrush}" BorderThickness="1,1,1,1" Width="Auto" Background="{StaticResource HeaderBackgroundBrush}">
  210.  
  211. <Grid Height="Auto" Width="Auto">
  212. <Grid.ColumnDefinitions>
  213. <ColumnDefinition/>
  214. <ColumnDefinition Width="30"/>
  215. </Grid.ColumnDefinitions>
  216.  
  217. <!--******************************************************标题***************************************-->
  218. <ContentControl Content="{TemplateBinding Title}" FontWeight="Bold" HorizontalAlignment="Stretch" IsTabStop="False"
  219. Margin="6,3,6,3" VerticalAlignment="Center"/>
  220.  
  221. <!--******************************************************关闭按钮***************************************-->
  222. <Button x:Name="CloseButton" Grid.Column="1" HorizontalAlignment="Center" Height="14" IsTabStop="False" Cursor="Hand"
  223. Style="{StaticResource ButtonStyle}" VerticalAlignment="Center" Width="15"/>
  224. </Grid>
  225. </Border>
  226.  
  227. <!--******************************************************主要内容区域***************************************-->
  228. <Border Background="{TemplateBinding Background}" Margin="7" Grid.Row="1">
  229. <ContentPresenter x:Name="ContentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  230. </Border>
  231. <!--******************************************************右下角 的透明三角形,控制伸缩***************************************-->
  232. <Path x:Name="Resizer" Data="M15.499995,0.5 L15.499995,15.5 L0.5,15.5 z" Fill="#FFB1B1B1"
  233. HorizontalAlignment="Right" Height="20" Opacity=".25" Grid.Row="1" Stretch="Fill" UseLayoutRounding="False"
  234. VerticalAlignment="Bottom" Width="20"/>
  235. </Grid>
  236. </Border>
  237. </Border>
  238. </Grid>
  239. </Grid>
  240. </ControlTemplate>
  241. </Setter.Value>
  242. </Setter>
  243. </Style>
  244. </ResourceDictionary>

FloatableWindowStyle.xaml

(5)简单地介绍一下如何设置一个控件的样式Style

首先设置一个标签<Style ></Style>,并设置一个x:Key,以作为引用的依据,并设置目标空间类型:TargetType。

利用如下的语句可以设置属性类型和属性值:

  1. <Setter Property="HorizontalContentAlignment" Value="Center"/>

通过自己的观察,可以研究其他类型的样式设计,比如色刷、渐变色等。

(三)引用控件的样式Style或样式文件

在“(一)(4)”中已经提到了资源字典文件ResourceDictionary的引用。此类文件,其实也是一种资源,与图片等资源的引用有些类似。

(1)比如,你在某一个工程下面设置了一个资源字典文件DropDownMenu.xaml,假如要在整个解决方案solution中引用,可以在App.xaml中做如下的引用

(2)如果开发者想在某一个控件中引用一个样式,可参考如下语句:

  1. <TextBlock x:Name="tbkNews" Style="{StaticResource menuTextBlockStyle}"
  2. MouseLeftButtonDown="tbkNews_MouseLeftButtonDown">

(3)如果给某一个窗口控件定义了样式,可参照如下的样式引用:

  1. <controls:ChildWindow.Style>
  2. <StaticResource ResourceKey="ChildWindowStyle"/>
  3. </controls:ChildWindow.Style>

小结一下,Silverlight支持界面的灵活设计,其与底层逻辑剥离,比较容易实现。同时资源字典文件和样式的使用可以大大提高已有界面的重用行,进而提高开发效率。而要获取某一个空间的资源文件,Blend会是一个很好的工具。所以,将Blend与资源字典文件结合使用,一定可以大大丰富界面,提升开发的进度。

Silverlight 样式的灵活使用的更多相关文章

  1. yii2的form表单样式怎么灵活控制呢?

    <?php $form = ActiveForm::begin(['id' => 'login-form', 'fieldConfig'=>[ 'template'=> &qu ...

  2. (转) silverlight 样式学习

    原文地址:http://www.cnblogs.com/Joetao/articles/2074727.html <UserControl x:Class="StyleDemo.Mai ...

  3. Silverlight样式定义

    方法一.定义在控件内部 <Canvas Background="Red" Height="100" HorizontalAlignment="L ...

  4. Word样式教程

    目录 写在前面 样式可以解决什么问题? 本文适合于 快速入门 一切皆样式 样式与格式的关系 如何修改样式 建立新的样式 样式的匹配和更新 根据样式更新所选段落 根据所选段落更新样式 小结 进一步了解 ...

  5. C# 6 与 .NET Core 1.0 高级编程 - 40 ASP.NET Core(上)

    译文,个人原创,转载请注明出处(C# 6 与 .NET Core 1.0 高级编程 - 40 章  ASP.NET Core(上)),不对的地方欢迎指出与交流. 章节出自<Professiona ...

  6. Prism 4 文档 ---第8章 导航

        作为同用户具有丰富的交互的客户端应用程序,它的用户界面(UI)将会持续不断的更新来反映用户工作的当前的任务和数据.用户界面可以进行一段时间相当大的变化作为用户交互的应用程序中完成各种任务.通过 ...

  7. AlloyRenderingEngine燃烧的进度条

    写在前面 Github: https://github.com/AlloyTeam/AlloyGameEngine HTML 5新增了progress标签,那么再去使用AlloyRenderingEn ...

  8. CSS系列——前端进阶之路:初涉Less

    前言:最近帮一个朋友解决点问题,在查看组件源码的时候涉及到了less语法,这可难倒博主了.没办法,既然用到就要学呗,谁让咱是无所不能的程序猿呢!所以今天来学习下Less,算是笔记,也希望给初学less ...

  9. java-excel导出

    java excel导出分为两种2003年的格式和2007年的格式. 2003年的xls一个sheet限制65536. 2007年的xlsx限制为1048576. jxl导入2003 gradle j ...

随机推荐

  1. BZOJ 2521: [Shoi2010]最小生成树(最小割)

    题意 对于某一条无向图中的指定边 \((a, b)\) , 求出至少需要多少次操作.可以保证 \((a, b)\) 边在这个无向图的最小生成树中. 一次操作指: 先选择一条图中的边 \((u, v)\ ...

  2. Netty如何实现Reactor模式

    在前面的文章中(Reactor模型详解),我们讲解了Reactor模式的各种演变形式,本文主要讲解的则是Netty是如何实现Reactor模式的.这里关于Netty实现的Reactor模式,需要说明的 ...

  3. python3 fileinput模块

    模块fileinput可以对一个或多个文件的内容所有行进行迭代.遍历等操作: 常用方法: fileinput.input(files=None, inplace=False, backup='', b ...

  4. 【CTSC2018】暴力写挂(边分治,虚树)

    [CTSC2018]暴力写挂(边分治,虚树) 题面 UOJ BZOJ 洛谷 题解 发现第二棵树上的\(LCA\)的深度这玩意没法搞,那么枚举在第二棵树上的\(LCA\). 然后剩下的部分就是\(dep ...

  5. 「SPOJ6340」「BZOJ1939」ZUMA - ZUMA【记忆化搜索】

    题目链接 [洛谷传送门] 题解 \(f[i][j][k]\)表示在消除了\((i,j)\),在后面加上了\(k\)个珠子的总的珠子数. 考虑三种决策:(题目给出的\(k\)在下文表示成\(K\)) 决 ...

  6. python 去重

    List: listA = ['python','python','言','是','一','门','动','态','语','言'] print sorted(set(listA), key = lis ...

  7. VS编译LESS插件

    1. LESS   用LESS写CSS可以用写程序代码的习惯写CSS.用了之后写CSS的效率会提高很多. 2.解释LESS 写出来的文件扩展名是.less,要运行的话,先解释成正常的CSS文件. 3. ...

  8. LaTex in Markdown

      上次写了Markdown,这次用到了LaTex,也出一期(吐槽,工作量比Markdown高太多...) Markdown基础:https://www.cnblogs.com/dotnetcrazy ...

  9. 全文检索 -- Solr从概念到实战(一)

    全文检索: 将整个文本进行“分词”处理,在索引库中为分词得到的每一个词都建立索引,和用户搜索的关键词进行匹配.实现快速查找效果. 传统sql语句实现的局限性: select song_id,song_ ...

  10. 《Java程序设计》 第一周学习总结

    20175313 <Java程序设计>第一周学习总结 教材学习内容总结 了解Java的四个特点 学习JDK的安装以及系统环境变量的设置 掌握Java源文件命名.编译.运行 熟悉git的常用 ...