-
Notifications
You must be signed in to change notification settings - Fork 0
/
Website.cs
63 lines (58 loc) · 1.57 KB
/
Website.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
using System;
using System.Drawing;
using System.Windows.Forms;
namespace DailyEvents
{
static public class Website
{
static public void Show(string group, string name)
{
Form dialog = new Form()
{
StartPosition = FormStartPosition.CenterScreen,
FormBorderStyle = FormBorderStyle.FixedSingle,
MaximizeBox = false,
Width = 410,
Height = 200,
Text = "Online version"
};
RichTextBox textBox = new RichTextBox()
{
Left = 15,
Top = 20,
Width = 360,
Height = 100,
ReadOnly = true,
BackColor = Color.LightGray,
Text = "You can use the following url to check this group online:\n" + AppInfo.OnlineUrl(group, name) + "\n\nOr click on the \"Online version\" button below for direct access."
};
Button websiteButton = new Button()
{
Left = 140,
Width = 120,
Top = 130,
Text = "Online version"
};
websiteButton.Click += (object sender, EventArgs e) =>
{
System.Diagnostics.Process.Start(AppInfo.OnlineUrl(group, name));
dialog.Close();
};
Button closeButton = new Button()
{
Left = 290,
Width = 80,
Top = 130,
Text = "Close"
};
closeButton.Click += (object sender, EventArgs e) =>
{
dialog.Close();
};
dialog.Controls.Add(textBox);
dialog.Controls.Add(websiteButton);
dialog.Controls.Add(closeButton);
dialog.ShowDialog();
}
}
}