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 ...
-
Using User Controls in Windows Forms Applications Windows Formsdagi UserControl base-sinfidan foydalanib User Conrol hosil qilishimiz...
-
Differences Between Task And Thread: 1. The Thread class is used for creating and manipulating a thread in Windows. 2. A Task represents ...
-
Java toString() metodi Ixtiyoriy ob’yektni string(satr) ko’rinishida ifodalash uchun doimo toString() metodidan foydalanamiz toStr...
No comments:
Post a Comment
Note: only a member of this blog may post a comment.