-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPanelChat.cs
More file actions
147 lines (125 loc) · 5.87 KB
/
PanelChat.cs
File metadata and controls
147 lines (125 loc) · 5.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Td = Telegram.Td;
using TdApi = Telegram.Td.Api;
namespace TelegramClient {
public partial class PanelChat : UserControl {
public int CurentHeight { get; set; } = 80;
public ChatsUserControl messagesPanel=new ChatsUserControl();
public long ID { get; set; }
public int _OldWidth;
public int _OldHeight;
public int _OldTop;
public int _OldLeft;
public Color color = Color.FromArgb(255, 30, 41, 55);
public Color color1 = Color.FromArgb(255, 30, 41, 55);
public Color color2 = Color.FromArgb(255, 30, 41, 55);
public DelegateChat delegateChat;
public PanelChat(DelegateChat delegateChat) {
this.delegateChat = delegateChat;
InitializeComponent();
}
//private void pictureBox1_MouseEnter(object sender, EventArgs e) {
// if (pictureBox1.ImageLocation != @"D:\2. Учёба\4 семестр\4. Сети ЭВМ\Курсовая работа\TelegramClient\Images\person.png") {
// //once mouse enters
// // take the backup of height width top left
// //so we can restore once mouse leaves
// //_OldTop = this.pictureBox1.Top;
// //_OldLeft = this.pictureBox1.Left;
// _OldWidth = this.pictureBox1.Width;
// _OldHeight = this.pictureBox1.Height;
// //decrease the control top left to show hover effect
// //this.pictureBox1.Top = this.pictureBox1.Top - 10;
// //this.pictureBox1.Left = this.pictureBox1.Left - 10;
// // same increase the height width
// this.pictureBox1.Height = this.pictureBox1.Height + 3;
// this.pictureBox1.Width = this.pictureBox1.Width + 3;
// this.pictureBox1.ClientSize = new Size(this.pictureBox1.Width, this.pictureBox1.Height);
// // show to control on top of all
// //this.BringToFront();
// this.pictureBox1.BringToFront();
// color = this.BackColor;
// this.BackColor = Color.FromArgb(255, BackColor.R - 5, BackColor.G - 5, BackColor.B - 5);
// //trigger the base event
// //base.OnMouseEnter(e);
// }
//}
//private void pictureBox1_MouseLeave(object sender, EventArgs e) {
//if (pictureBox1.ImageLocation != @"D:\2. Учёба\4 семестр\4. Сети ЭВМ\Курсовая работа\TelegramClient\Images\person.png") {
// // mouse leaves now we have to restore
// //picture box to its original position
// this.pictureBox1.Height = _OldHeight;
// this.pictureBox1.Width = _OldWidth;
// //this.pictureBox1.Left = _OldLeft;
// //this.pictureBox1.Top = _OldTop;
// this.pictureBox1.ClientSize = new Size(this.pictureBox1.Width, this.pictureBox1.Height);
// //base.OnMouseLeave(e);
// this.BackColor= color ;
//}
//}
private void PanelChat_MouseClick(object sender, MouseEventArgs e) {
messagesPanel.BringToFront();
MainForm.CurChatID = ID;
//this.BackColor = Color.FromArgb(26,37,51);
delegateChat(ID);
}
private void pictureBox1_MouseClick(object sender, MouseEventArgs e) {
messagesPanel.BringToFront();
MainForm.CurChatID = ID;
//this.BackColor = Color.FromArgb(26, 37, 51);
delegateChat(ID);
}
private void label1_Click(object sender, EventArgs e) {
messagesPanel.BringToFront();
MainForm.CurChatID = ID;
//this.BackColor = Color.FromArgb(26, 37, 51);
delegateChat(ID);
}
private void label1_MouseEnter(object sender, EventArgs e) {
color = this.label1.BackColor;
color1 = this.pictureBox1.BackColor;
color2 = this.BackColor;
this.label1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.pictureBox1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.BackColor = Color.FromArgb(255, 50, 61, 75);
}
private void label1_MouseLeave(object sender, EventArgs e) {
this.label1.BackColor = color;
this.pictureBox1.BackColor = color1;
this.BackColor = color2;
}
private void pictureBox1_MouseEnter_1(object sender, EventArgs e) {
color = this.label1.BackColor;
color1 = this.pictureBox1.BackColor;
color2 = this.BackColor;
this.label1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.pictureBox1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.BackColor = Color.FromArgb(255, 50, 61, 75);
}
private void pictureBox1_MouseLeave_1(object sender, EventArgs e) {
this.label1.BackColor = color;
this.pictureBox1.BackColor = color1;
this.BackColor = color2;
}
private void PanelChat_MouseEnter(object sender, EventArgs e) {
color = this.label1.BackColor;
color1 = this.pictureBox1.BackColor;
color2 = this.BackColor;
this.label1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.pictureBox1.BackColor = Color.FromArgb(255, 50, 61, 75);
this.BackColor = Color.FromArgb(255, 50, 61, 75);
}
private void PanelChat_MouseLeave(object sender, EventArgs e) {
this.label1.BackColor = color;
this.pictureBox1.BackColor = color1;
this.BackColor = color2;
}
}
}