4
4
using System . Data ;
5
5
using System . Drawing ;
6
6
using System . Linq ;
7
+ using System . Reflection . Emit ;
7
8
using System . Text ;
8
9
using System . Threading . Tasks ;
9
10
using System . Windows . Forms ;
@@ -14,6 +15,7 @@ namespace RishWinTools
14
15
public partial class MainForm : Form
15
16
{
16
17
private TabControl Tabs ;
18
+ private Panel Footer ;
17
19
private readonly System . ComponentModel . IContainer ? Components ;
18
20
19
21
protected override void Dispose ( bool disposing )
@@ -32,8 +34,9 @@ public MainForm()
32
34
Text = "RishWinTools" ;
33
35
AutoScaleDimensions = new SizeF ( 6F , 13F ) ;
34
36
AutoScaleMode = AutoScaleMode . Font ;
35
- ClientSize = new Size ( 800 , 600 ) ;
37
+ ClientSize = new Size ( 1024 , 600 ) ;
36
38
StartPosition = FormStartPosition . CenterScreen ;
39
+ Icon = new Icon ( "icon.ico" ) ;
37
40
38
41
// Tabs
39
42
Tabs = new TabControl ( ) ;
@@ -45,13 +48,65 @@ public MainForm()
45
48
Tabs . SelectedIndexChanged += onTabControlSelectedIndexChanged ;
46
49
Tabs . SuspendLayout ( ) ;
47
50
Controls . Add ( Tabs ) ;
48
-
49
- // Add servers tab
50
51
Tabs . Controls . Add ( new Servers . ServersTab ( Tabs ) ) ;
51
-
52
- // Add keys tab
53
52
Tabs . Controls . Add ( new Keys . KeysTab ( Tabs ) ) ;
54
53
54
+
55
+ // Footer
56
+ Footer = new Panel
57
+ {
58
+ Dock = DockStyle . Bottom ,
59
+ BackColor = Color . White
60
+ } ;
61
+ Controls . Add ( Footer ) ;
62
+
63
+ PictureBox footerLogo = new PictureBox
64
+ {
65
+ Image = Image . FromFile ( "logo.png" ) ,
66
+ SizeMode = PictureBoxSizeMode . Zoom ,
67
+ Size = new Size ( 100 , 80 ) ,
68
+ Location = new Point ( 10 , 10 )
69
+ } ;
70
+ Footer . Controls . Add ( footerLogo ) ;
71
+
72
+ System . Windows . Forms . Label footerTitle = new System . Windows . Forms . Label
73
+ {
74
+ Text = "Rish Windows Tools" ,
75
+ Location = new Point ( footerLogo . Right + 20 , 10 ) ,
76
+ AutoSize = true
77
+ } ;
78
+ footerTitle . Font = new Font ( footerTitle . Font , FontStyle . Bold ) ;
79
+ Footer . Controls . Add ( footerTitle ) ;
80
+
81
+ System . Windows . Forms . Label footerAuthor = new System . Windows . Forms . Label
82
+ {
83
+ Text = "by Igor Berdichevskiy" ,
84
+ Location = new Point ( footerLogo . Right + 20 , footerTitle . Bottom + 5 ) ,
85
+ AutoSize = true
86
+ } ;
87
+ Footer . Controls . Add ( footerAuthor ) ;
88
+
89
+ LinkLabel footerLink = new LinkLabel
90
+ {
91
+ Text = "Перейти на сайт rish.su" ,
92
+ Location = new Point ( footerLogo . Right + 20 , footerAuthor . Bottom + 5 ) ,
93
+ AutoSize = true
94
+ } ;
95
+ footerLink . LinkClicked += ( sender , e ) => System . Diagnostics . Process . Start ( "http://rish.su" ) ;
96
+ Footer . Controls . Add ( footerLink ) ;
97
+
98
+ int footerHeight = 0 ;
99
+ foreach ( Control control in Footer . Controls )
100
+ {
101
+ int controlBottom = control . Bottom ;
102
+ if ( controlBottom > footerHeight )
103
+ {
104
+ footerHeight = controlBottom ;
105
+ }
106
+ }
107
+ Footer . Height = footerHeight ;
108
+
109
+ // Layout
55
110
Tabs . ResumeLayout ( false ) ;
56
111
}
57
112
0 commit comments