-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathForm1.cs
99 lines (80 loc) · 2.53 KB
/
Form1.cs
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
using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace PhotoViewer
{
public partial class Form1 : DevExpress.XtraEditors.XtraForm
{
FormState formState = new FormState();
public Form1()
{
InitializeComponent();
photoEditor1.HideAndShowThumbnail_Changed += PhotoEditor1_HideAndShowThumbnail_Changed;
photoEditor1.PopupMenuPhotoViewer_Clicked += PhotoEditor1_PopupMenuPhotoViewer_Clicked;
}
private void PhotoEditor1_PopupMenuPhotoViewer_Clicked(object sender, PopupMenuPhotoViewerClickedEventArgs e)
{
if(sender is SimpleButton)
{
var control = (SimpleButton)sender;
if (control.Name == "btn_dong")
{
this.Close();
}
else if (control.Name == "btn_mini")
{
this.WindowState = FormWindowState.Minimized;
}
else if (control.Name == "btn_max")
{
this.WindowState = FormWindowState.Normal;
}
}
else
{
if (e == null) { return; }
if (e.ButtonNameClicked.Name == "btn_close")
{
this.Close();
}
else if (e.ButtonNameClicked.Name == "btn_mini")
{
this.WindowState = FormWindowState.Minimized;
}
else if (e.ButtonNameClicked.Name == "btn_them")
{
}
else if (e.ButtonNameClicked.Name == "btn_xoa")
{
}
}
}
private void PhotoEditor1_HideAndShowThumbnail_Changed(object sender, PhotoViewerHideAndShowThumbnailEventArgs e)
{
if (e.Status)
{
formState.Maximize(this);
}
else
{
formState.Restore(this);
}
}
private void Form1_Load(object sender, EventArgs e)
{
photoEditor1.URL_IMAGE = @"images";
formState.Maximize(this);
}
private void btn_close_Click(object sender, EventArgs e)
{
this.Close();
}
}
}