WPF da Canvas ning MouseWheel eventini handle qilish
Odatda Canvas yaratib, unga ixtiyoriyta Children add qilganimizda
va undagi MouseWheel eventini qayta ishlashimiz uchun:
canvas1.Background = Brushes.Transparent; deb olishimiz yoki umumiy olganda
yaratgan canvas1 objectimizning Background qiymatini o'rnatishimiz kerak;
aks holda MouseWheel event ni hadle qila olmaymiz. Chunki default holatda
Canvas Background siz yaratiladi.
Masalan:
...
Canvas canvas1 = new Canvas();
canvas1.Background = Brushes.Transparent;
Label label = new Label();
label.Content = "This is Text";
label.Foreground = Brushes.Blue;
label.FontSize = 12;
label.FontWeight = FontWeights.Bold;
canvas1.Children.add(label);
canvas1.MouseWheel+=Canvas1_Mouseheel;
...
void Canvas1_Mouseheel()
{
...
}
Subscribe to:
Post Comments (Atom)
Tasks and Threads
Differences Between Task And Thread: 1. The Thread class is used for creating and manipulating a thread in Windows. 2. A Task represents ...
-
Differences Between Task And Thread: 1. The Thread class is used for creating and manipulating a thread in Windows. 2. A Task represents ...
-
MANSURJON KURTOV I was born in 1983 , lived 20 years in Bukhara and I have been living in Tashkent since 2007. I started ...
-
Using User Controls in Windows Forms Applications Windows Formsdagi UserControl base-sinfidan foydalanib User Conrol hosil qilishimiz...
No comments:
Post a Comment
Note: only a member of this blog may post a comment.