当前位置:网站首页>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 !
边栏推荐
- On Data Mining
- Shell pass parameters
- RT-Thread--Lwip之FTP(2)
- Overview of super-resolution reconstruction of remote sensing images
- Multi project programming minimalist use case
- 在字节做测试5年,7月无情被辞,想给划水的兄弟提个醒
- Yyds dry inventory what is test driven development
- 在 .NET 6 中使用 Startup.cs 更简洁的方法
- Align items and align content in flex layout
- Recommended papers on remote sensing image super-resolution
猜你喜欢

Facebook等大厂超十亿用户数据遭泄露,早该关注DID了

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

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

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

MADDPG的pythorch实现——(1)OpenAI MADDPG环境配置

2.2 STM32 GPIO操作

SWC introduction

Serial port-rs232-rs485-ttl

Suggestions for new engineer team members

Flask learning and project practice 8: introduction and use of cookies and sessions
随机推荐
No qualifying bean of type ‘......‘ available
[practical exercise] face location model based on skin color
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
C#(二十九)之C#listBox checkedlistbox imagelist
Blue style mall website footer code
Overview of super-resolution reconstruction of remote sensing images
pytorch加载数据
Teach you to build your own simple BP neural network with pytoch (take iris data set as an example)
UDP reliable transport protocol (quic)
Take you to wechat applet development in 3 minutes
three. JS page background animation liquid JS special effect
出现Permission denied的解决办法(750权限谨慎使用)
User experience index system
Pytorch基础——(1)张量(tensor)的初始化
简易博客系统
Schnuka: what is visual positioning system and how to position it
Cubemx transplantation punctual atom LCD display routine
EDCircles: A real-time circle detector with a false detection control 翻译
A brief introduction to symbols and link libraries in C language
Microkernel structure understanding