当前位置:网站首页>WPF effect Article 191 box selection listbox
WPF effect Article 191 box selection listbox
2022-07-06 03:46:00 【Dotnet cross platform】
The previous effect is based on ListBox Achieved a little different effect ; Today, the box selection is improved again on the original basis ListBox; The final effect , Here's the picture :
1、 Used VisualTreeHelper Of HitTest Method :
Point point2 = e.GetPosition(LedListBox);
Rect rect = new Rect(origContentMouseDownPoint, point2);
RectangleGeometry rectangleGeometry = new RectangleGeometry(rect);
VisualTreeHelper.HitTest(LedListBox, new HitTestFilterCallback(OnHitTestFilterCallback), new HitTestResultCallback(OnHitTestResultCallback), new GeometryHitTestParameters(rectangleGeometry));2、 About OnHitTestFilterCallback:
private HitTestFilterBehavior OnHitTestFilterCallback(DependencyObject target)
{
UIElement element = target as UIElement;
if(element != null)
{
var img = element as CheckBox;
if(img != null && img.IsVisible == true)
{
img.IsChecked = true;
return HitTestFilterBehavior.Continue;
}
}
return HitTestFilterBehavior.Continue;
} The final simple effect is this
; If you have time later , You can explore more complex effects
; Programming never stops 、Bug More than 、 nothing Bug、 No life
; Change bug Calm down 、 The passion of coding 、 Joy after completion 、 The excitement of digging a hole 、 The excitement of filling the hole ; Maybe that's the fun of lousy programmers ; Come here today ; I hope I have the motivation to persist step by step ; Life is endless , Code is more than ; You can take time to see the effect of today's sharing , Have good opinions and ideas , You can leave a message on the message board ; I will reply you as soon as I see it , Thank you for your attention and support ! If it feels good , Then reach out your little hand, praise and pay attention to !
边栏推荐
- 【Rust 笔记】18-宏
- 在字节做测试5年,7月无情被辞,想给划水的兄弟提个醒
- 2.2 STM32 GPIO operation
- The ECU of 21 Audi q5l 45tfsi brushes is upgraded to master special adjustment, and the horsepower is safely and stably increased to 305 horsepower
- 3分钟带你了解微信小程序开发
- [analysis of variance] single factor analysis and multi factor analysis
- 阿里测试师用UI自动化测试实现元素定位
- Teach you to build your own simple BP neural network with pytoch (take iris data set as an example)
- 如何修改表中的字段约束条件(类型,default, null等)
- P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
猜你喜欢
![[optimization model] Monte Carlo method of optimization calculation](/img/e6/2865806ffbbfaa8cc07ebf625fcde6.jpg)
[optimization model] Monte Carlo method of optimization calculation

C#(二十九)之C#listBox checkedlistbox imagelist

Exness foreign exchange: the governor of the Bank of Canada said that the interest rate hike would be more moderate, and the United States and Canada fell slightly to maintain range volatility

KS008基于SSM的新闻发布系统
![[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board](/img/07/973722bf484b374f752177dfc48ef5.png)
[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board

After five years of testing in byte, I was ruthlessly dismissed in July, hoping to wake up my brother who was paddling

cookie,session,Token 这些你都知道吗?

ESBuild & SWC浅谈: 新一代构建工具

SWC介绍

EDCircles: A real-time circle detector with a false detection control 翻译
随机推荐
BUAA calculator (expression calculation - expression tree implementation)
出现Permission denied的解决办法(750权限谨慎使用)
Prime Protocol宣布在Moonbeam上的跨链互连应用程序
User experience index system
自动化测试怎么规范部署?
MySQL 中的数据类型介绍
3.1 detailed explanation of rtthread serial port device (V1)
Pointer for in-depth analysis (problem solution)
The solution of permission denied (750 permissions should be used with caution)
BUAA计算器(表达式计算-表达式树实现)
2.1 rtthread pin device details
[slam] lidar camera external parameter calibration (Hong Kong University marslab) does not need a QR code calibration board
Blue style mall website footer code
[matlab] - draw a five-star red flag
C language judgment, ternary operation and switch statement usage
简述C语言中的符号和链接库
Mapping between QoE and KQI
潘多拉 IOT 开发板学习(HAL 库)—— 实验9 PWM输出实验(学习笔记)
SWC introduction
[analysis of variance] single factor analysis and multi factor analysis