-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathloading.h
More file actions
150 lines (134 loc) · 4.63 KB
/
loading.h
File metadata and controls
150 lines (134 loc) · 4.63 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
147
148
149
150
#pragma
#include"MyForm.h"
namespace DictionaryProject {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for loading
/// </summary>
public ref class loading : public System::Windows::Forms::Form
{
public: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
timer1->Start(); // Start the timer on form load
}
void StartLoadingAnimation()
{
// Your loading animation logic, for example, starting a timer
timer1->Start();
}
System::Windows::Forms::Timer^ timer1;
int animationDuration; // Duration of the loading animation in milliseconds
// Method to initialize the loading animation
void InitializeLoadingAnimation()
{
timer1 = gcnew System::Windows::Forms::Timer();
animationDuration = 1000; // Set the animation duration to 3 seconds
// Set up the timer properties
timer1->Interval = animationDuration;
timer1->Tick += gcnew System::EventHandler(this, &loading::timer1_Tick);
// Set ForeColor of ProgressBar to green
progressBar1->ForeColor = System::Drawing::Color::Green;
// Set MarqueeAnimationSpeed for visual appeal
progressBar1->MarqueeAnimationSpeed = 50;
// Set the Style property to Marquee
progressBar1->Style = System::Windows::Forms::ProgressBarStyle::Marquee;
}
public:
loading(void)
{
InitializeComponent();
InitializeLoadingAnimation();
//
//TODO: Add the constructor code here
//
}
// Event handler for the timer tick event
System::Void timer1_Tick(System::Object^ sender, System::EventArgs^ e)
{
timer1->Stop(); // Stop the timer when the animation duration is reached
MyForm^ form = gcnew MyForm;
form->Show();
// Optionally, perform any other actions or navigate to the next form
this->Close(); // Close the loading form (or navigate to the next form)
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~loading()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::ProgressBar^ progressBar1;
private: System::ComponentModel::IContainer^ components;
protected:
private:
/// <summary>
/// Required designer variable.
/// </summary>
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
this->label1 = (gcnew System::Windows::Forms::Label());
this->progressBar1 = (gcnew System::Windows::Forms::ProgressBar());
this->timer1 = (gcnew System::Windows::Forms::Timer(this->components));
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(85, 56);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(65, 16);
this->label1->TabIndex = 0;
this->label1->Text = L"Loading...";
//
// progressBar1
//
this->progressBar1->ForeColor = System::Drawing::Color::Lime;
this->progressBar1->Location = System::Drawing::Point(88, 87);
this->progressBar1->Name = L"progressBar1";
this->progressBar1->Size = System::Drawing::Size(207, 23);
this->progressBar1->TabIndex = 1;
this->progressBar1->Click += gcnew System::EventHandler(this, &loading::progressBar1_Click);
//
// loading
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(383, 157);
this->ControlBox = false;
this->Controls->Add(this->progressBar1);
this->Controls->Add(this->label1);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::None;
this->MaximizeBox = false;
this->MinimizeBox = false;
this->Name = L"loading";
this->ShowIcon = false;
this->ShowInTaskbar = false;
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = L"Loading";
this->Load += gcnew System::EventHandler(this, &loading::loading_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void progressBar1_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void loading_Load(System::Object^ sender, System::EventArgs^ e) {
}
};
}