原文:Blend Grid行列拖拽控制宽高

看效果


  1. <Grid>
  2. <Grid.ColumnDefinitions>
  3. <ColumnDefinition Width="212*"/>
  4. <ColumnDefinition Width="9*"/>
  5. <ColumnDefinition Width="296*"/>
  6. </Grid.ColumnDefinitions>
  7. <Grid.RowDefinitions>
  8. <RowDefinition Height="161*"/>
  9. <RowDefinition Height="6*"/>
  10. <RowDefinition Height="153*"/>
  11. </Grid.RowDefinitions>
  12. <Button Content="Button" Margin="0"/>
  13. <Button Content="Button" Margin="0,0,0,1" Grid.Row="2"/>
  14. <Button Content="Button" Grid.Column="2"/>
  15. <Button Content="Button" Grid.Column="2" Grid.Row="2"/>
  16. <GridSplitter HorizontalAlignment="Center" Margin="2,0" Grid.RowSpan="3" Width="5" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
  17. <GridSplitter.RenderTransform>
  18. <TransformGroup>
  19. <ScaleTransform/>
  20. <SkewTransform/>
  21. <RotateTransform Angle="0.349"/>
  22. <TranslateTransform/>
  23. </TransformGroup>
  24. </GridSplitter.RenderTransform>
  25. </GridSplitter>
  26. <GridSplitter Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Margin="0,3" Grid.Row="1" VerticalAlignment="Center" Height="5"/>
  27. </Grid>

效果2

主要设置俩个地方 注意设置列 auto

1)最外层gridGrid.IsSharedSizeScope="True"

2)设置GridSplitter 所在列或行  SharedSizeGroup


  1. <Grid Grid.IsSharedSizeScope="True" >
  2. <Grid Margin="19,182,60,48" Background="White">
  3. <Grid.ColumnDefinitions>
  4. <ColumnDefinition Width="377*"/>
  5. <ColumnDefinition Width="16*" />
  6. <ColumnDefinition Width="Auto" SharedSizeGroup="aaa"/>
  7. </Grid.ColumnDefinitions>
  8. <Grid.RowDefinitions>
  9. <RowDefinition Height="9*"/>
  10. <RowDefinition/>
  11. <RowDefinition Height="8*"/>
  12. </Grid.RowDefinitions>
  13. <Button Content="Button" Margin="0"/>
  14. <Button Content="Button" Margin="0,0,0,1" Grid.Row="2"/>
  15. <Button Content="Button" Grid.Column="2"/>
  16. <Button Content="Button" Grid.Column="2" Grid.Row="2"/>
  17. <GridSplitter HorizontalAlignment="Center" Margin="1.313,0,1.312,0" Grid.RowSpan="3" Width="5" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
  18. <GridSplitter.RenderTransform>
  19. <TransformGroup>
  20. <ScaleTransform/>
  21. <SkewTransform/>
  22. <RotateTransform Angle="0.349"/>
  23. <TranslateTransform/>
  24. </TransformGroup>
  25. </GridSplitter.RenderTransform>
  26. </GridSplitter>
  27. <GridSplitter Grid.ColumnSpan="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="5" Grid.Row="1"/>
  28. </Grid>
  29. <Grid Margin="19,61,60,169" Background="White">
  30. <Grid.ColumnDefinitions>
  31. <ColumnDefinition Width="377*" />
  32. <ColumnDefinition Width="16*" />
  33. <ColumnDefinition Width="Auto" SharedSizeGroup="aaa"/>
  34. </Grid.ColumnDefinitions>
  35. <Grid.RowDefinitions>
  36. <RowDefinition Height="15*" />
  37. <RowDefinition Height="2*"/>
  38. <RowDefinition Height="13*"/>
  39. </Grid.RowDefinitions>
  40. <Button Content="Button" Margin="0"/>
  41. <Button Content="Button" Margin="0,0,0,1" Grid.Row="2"/>
  42. <Button Content="Button" Grid.Column="2"/>
  43. <Button Content="Button" Grid.Column="2" Grid.Row="2"/>
  44. <GridSplitter HorizontalAlignment="Center" Margin="1.313,0,1.312,0" Grid.RowSpan="3" Width="5" Grid.Column="1" RenderTransformOrigin="0.5,0.5">
  45. <GridSplitter.RenderTransform>
  46. <TransformGroup>
  47. <ScaleTransform/>
  48. <SkewTransform/>
  49. <RotateTransform Angle="0.349"/>
  50. <TranslateTransform/>
  51. </TransformGroup>
  52. </GridSplitter.RenderTransform>
  53. </GridSplitter>
  54. <GridSplitter Grid.ColumnSpan="3" HorizontalAlignment="Stretch" Margin="0,1,0,0" VerticalAlignment="Center" Height="5" Grid.Row="1"/>
  55. </Grid>
  56. </Grid>

Blend Grid行列拖拽控制宽高的更多相关文章

  1. FMX ScrollBox 拖拽控制

    Firemonkey下的ScrollBox 拖拽控制,滚动控制,拖拽,滚动条 AniCalculations 仅允许纵向拖拽,拖拽 scrlbx.AniCalculations.TouchTracki ...

  2. 案例(拖拽对话框、高清放大镜、自制滚动条、元素的隐藏方式、表格隔行变色、tab切换效果、字符串拼接、刷新评论)

    一.拖拽对话框 <style> .of{ width: 500px; } #link,#close{ text-decoration: none; margin: 0 10px; font ...

  3. textarea拖拽控制

    一.用处 textarea默认时允许用户以拖拽形式来改变textarea大小,但textarea的大小变化会撑大其父节点,有时会破坏整体布局,有时我们并不希望textarea随意拖拽. forklif ...

  4. el-table实现行列拖拽

    element ui 表格没有自带的拖拽排序的功能,只能借助第三方插件Sortablejs来实现. 实现步骤: 安装Sortable.js npm install sortablejs --save ...

  5. element ui + sortablejs实现表格的行列拖拽

    <template> <div class="container"> <el-table :data="tableData" bo ...

  6. div拖拽的问题

    今天看到一篇写的很好的文章,摘抄如下: 思路 父盒子相对定位,子元素,也就是被拖拽的元素绝对定位 当鼠标在子元素中按下时,绑定鼠标移动事件,根据鼠标位置改变元素位置 设置鼠标当前位置(offsetX, ...

  7. JQUERY 拖拽 draggable droppable resizable selectable sortable

    今天用了jq ui的拖动碰撞功能,好不容易看到有详细的API解说,记录如下:   <script language="JavaScript" type="text/ ...

  8. html5 Sortable.js 拖拽排序源码分析

    最近公司项目经常用到一个拖拽 Sortable.js插件,所以有空的时候看了 Sortable.js 源码,总共1300多行这样,写的挺完美的.   本帖属于原创,转载请出名出处. 官网http:// ...

  9. CSS 奇思妙想 | 使用 resize 实现强大的图片拖拽切换预览功能

    本文将介绍一个非常有意思的功能,使用纯 CSS 利用 resize 实现强大的图片切换预览功能.类似于这样: 思路 首先,要实现这样一个效果如果不要求可以拖拽,其实有非常多的办法. 将两张图片叠加在一 ...

随机推荐

  1. youtube视频在线下载

    youtube视频在线下载网站: https://www.clipconverter.cc/ youtube视频样例: https://www.youtube.com/watch?v=NMkgz0AR ...

  2. afnet缓存

    http://www.open-open.com/code/view/1432299750333

  3. 智能家居-2.基于esp8266的语音控制系统(硬件篇)

    智能家居-1.基于esp8266的语音控制系统(开篇) 智能家居-2.基于esp8266的语音控制系统(硬件篇) 智能家居-3.基于esp8266的语音控制系统(软件篇) 赞赏支持 QQ:505645 ...

  4. svn导一份历史版本出来

    然后: 点击最上面的Show log ; 选择你要的版本: 右键, export, 然后就可以选择需要导出的文件夹 主要有时候开发新功能然后覆盖到项目里面去了,但是产品可能需要在旧版本上面修改其他东西 ...

  5. 服务器Oracle数据库配置与客户端访问数据库的一系列必要设置

    tips:所有路径请对应好自己电脑的具体文件路径. 一.服务器及Oracle数据库设置 1.刚装完的Oracle数据库中只有一个dba账户,首先需要创建一个用户. 2.配置监听,C:\app\Admi ...

  6. [Go] golang的MPG调度模型

    MPG模式运行状态11)当前程序有三个M,如果三个M都在一个cpu运行,就是并发,如果在不同的cpu运行就是并行2)M1,M2,M3正在执行一个G,M1的协程队列有三个,M2的协程队列有三个,M3的协 ...

  7. Windows Server 2016-Hyper-V Replica副本功能介绍

    Hyper-V副本是一种可用于复制虚拟机的功能,作为业务连续性解决方案的一部分.从Windows Server 2012中,Hyper-V角色引入了Hyper-V Replica作为虚拟机的内置复制机 ...

  8. 链接(url)中不能有汉字,遇到汉字,需要使用quote转换之后使用

    from urllib.parse import quotename=quote("翻译")print(name)

  9. JWT 学习资料

    学习资料 网址 官方网站 https://jwt.io/ debugger https://jwt.io/#debugger 相关的类库 https://jwt.io/#libraries (java ...

  10. python27期尚哥讲并发编程:

    python27day23并发编程----------------------------------------------------------------------------------- ...