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
|
#include <msclr\marshal_cppstd.h>
#include<string>
#include"Controller.h"
#include"userData.h"
#pragma once
namespace payRollGui {
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 MyForm
/// </summary>
public ref class MyForm : public System::Windows::Forms::Form
{
public:
MyForm(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~MyForm()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ usernameLabel;
protected:
private: System::Windows::Forms::Label^ passwordLabel;
private: System::Windows::Forms::TextBox^ usernameTextBox;
private: System::Windows::Forms::TextBox^ passwordTextBox;
private: System::Windows::Forms::Button^ loginButton;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#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->usernameLabel = (gcnew System::Windows::Forms::Label());
this->passwordLabel = (gcnew System::Windows::Forms::Label());
this->usernameTextBox = (gcnew System::Windows::Forms::TextBox());
this->passwordTextBox = (gcnew System::Windows::Forms::TextBox());
this->loginButton = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// usernameLabel
//
this->usernameLabel->AutoSize = true;
this->usernameLabel->Location = System::Drawing::Point(43, 78);
this->usernameLabel->Name = L"usernameLabel";
this->usernameLabel->Size = System::Drawing::Size(55, 13);
this->usernameLabel->TabIndex = 0;
this->usernameLabel->Text = L"Username";
//
// passwordLabel
//
this->passwordLabel->AutoSize = true;
this->passwordLabel->Location = System::Drawing::Point(43, 120);
this->passwordLabel->Name = L"passwordLabel";
this->passwordLabel->Size = System::Drawing::Size(53, 13);
this->passwordLabel->TabIndex = 1;
this->passwordLabel->Text = L"Password";
this->passwordLabel->Click += gcnew System::EventHandler(this, &MyForm::passwordLabel_Click);
//
// usernameTextBox
//
this->usernameTextBox->Location = System::Drawing::Point(115, 78);
this->usernameTextBox->Name = L"usernameTextBox";
this->usernameTextBox->Size = System::Drawing::Size(121, 20);
this->usernameTextBox->TabIndex = 2;
//
// passwordTextBox
//
this->passwordTextBox->Location = System::Drawing::Point(115, 120);
this->passwordTextBox->Name = L"passwordTextBox";
this->passwordTextBox->PasswordChar = '*';
this->passwordTextBox->Size = System::Drawing::Size(121, 20);
this->passwordTextBox->TabIndex = 3;
//
// loginButton
//
this->loginButton->Location = System::Drawing::Point(115, 179);
this->loginButton->Name = L"loginButton";
this->loginButton->Size = System::Drawing::Size(75, 23);
this->loginButton->TabIndex = 4;
this->loginButton->Text = L"Login";
this->loginButton->UseVisualStyleBackColor = true;
this->loginButton->Click += gcnew System::EventHandler(this, &MyForm::loginButton_Click);
//
// MyForm
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(284, 261);
this->Controls->Add(this->loginButton);
this->Controls->Add(this->passwordTextBox);
this->Controls->Add(this->usernameTextBox);
this->Controls->Add(this->passwordLabel);
this->Controls->Add(this->usernameLabel);
this->Name = L"MyForm";
this->Text = L"Payroll v0.1";
this->Load += gcnew System::EventHandler(this, &MyForm::MyForm_Load);
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
private: System::Void MyForm_Load(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void passwordLabel_Click(System::Object^ sender, System::EventArgs^ e) {
}
private: System::Void loginButton_Click(System::Object^ sender, System::EventArgs^ e) {
string username = marshal_as<string>(usernameTextBox->Text);
}
};
}
|