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
|
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
public ref class MsgBoxUI : public System::Windows::Forms::Form {
System::Windows::Forms::Label^ label;
System::Windows::Forms::Button^ button1;
System::Windows::Forms::Button^ button2;
System::Windows::Forms::Button^ button3;
System::ComponentModel::Container^ components;
MsgBoxUI(std::string title, std::string caption, std::string b1txt, std::string b2txt, std::string b3txt, char icon){
initComponents(title,caption,b1txt,b2txt,b3txt,icon);
};
~MsgBoxUI(){
if (components){
delete components;
}
}
void initComponents(std::string title, std::string caption, std::string b1txt, std::string b2txt, std::string b3txt, char icon){
//
// System
//
this->label = (gcnew System::Windows::Forms::Label());
this->button1 = (gcnew System::Windows::Forms::Button());
this->button2 = (gcnew System::Windows::Forms::Button());
this->button3 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label
//
this->label->AutoSize = true;
this->label->Location = System::Drawing::Point(12, 9);
this->label->Name = L"label";
this->label->Size = System::Drawing::Size(30, 13);
this->label->TabIndex = 1;
this->label->Text = Custom::ConvertString(caption);
//
// InputBox
//
//this->AcceptButton = this->bOk;
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
//this->CancelButton = this->bCancel;
this->ClientSize = System::Drawing::Size(284, 101);
this->Controls->Add(this->label);
this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedSingle;
//this->MaximizeBox = false;
this->Name = L"MsgBoxUI";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = Custom::ConvertString(title);
this->TopMost = true;
this->ResumeLayout(false);
this->PerformLayout();
}
int returnValue(){
return 0;
}
};
| |