当前位置:网站首页>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 !
边栏推荐
- Cross origin cross domain request
- Data analysis Seaborn visualization (for personal use)
- No qualifying bean of type ‘......‘ available
- A brief introduction to symbols and link libraries in C language
- Cubemx transplantation punctual atom LCD display routine
- MySQL reads missing data from a table in a continuous period of time
- 简易博客系统
- Restful style
- 【SLAM】lidar-camera外参标定(港大MarsLab)无需二维码标定板
- Schnuka: visual positioning system working principle of visual positioning system
猜你喜欢
【SLAM】ORB-SLAM3解析——跟踪Track()(3)
Pytoch foundation - (1) initialization of tensors
RT thread -- FTP of LwIP (2)
BUAA calculator (expression calculation - expression tree implementation)
Canvas cut blocks game code
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
3.1 rtthread 串口设备(V1)详解
MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置
Exchange bottles (graph theory + thinking)
[optimization model] Monte Carlo method of optimization calculation
随机推荐
Pelosi: Congress will soon have legislation against members' stock speculation
Introduction to data types in MySQL
在 .NET 6 中使用 Startup.cs 更简洁的方法
How to standardize the deployment of automated testing?
BUAA calculator (expression calculation - expression tree implementation)
遥感图像超分辨重建综述
1、工程新建
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
P7735-[noi2021] heavy and heavy edges [tree chain dissection, line segment tree]
2.2 STM32 GPIO操作
JS Vanke banner rotation chart JS special effect
Record the process of reverse task manager
RT-Thread--Lwip之FTP(2)
The solution of permission denied (750 permissions should be used with caution)
SWC introduction
Microkernel structure understanding
Oracle ORA error message
2.1 rtthread pin device details
cookie,session,Token 这些你都知道吗?
[slam] orb-slam3 parsing - track () (3)