⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.h

📁 This rar contains code from every chapter of Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008.Mar
💻 H
📖 第 1 页 / 共 2 页
字号:
#pragma once
#include "LottoLimitsDialog.h"
#include "EuroLimitsDialog.h"
#include "UserValueDialog.h"

namespace Ex22_01 {

	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 Form1
	///
	/// WARNING: If you change the name of this class, you will need to change the
	///          'Resource File Name' property for the managed resource compiler tool
	///          associated with all .resx files this class depends on.  Otherwise,
	///          the designers will not be able to interact properly with localized
	///          resources associated with this form.
	/// </summary>
	public ref class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
: lottoValuesCount(6),
euroValuesCount(5), euroStarsCount(2),
lottoLowerLimit(1),lottoUpperLimit(49),
lottoUserMinimum(lottoLowerLimit),lottoUserMaximum(lottoUpperLimit),
euroLowerLimit(1), euroUpperLimit(50),
euroStarsLowerLimit(1),euroStarsUpperLimit(9),
euroUserMinimum(euroLowerLimit),euroUserMaximum(euroUpperLimit),
euroStarsUserMinimum(euroStarsLowerLimit),euroStarsUserMaximum(euroStarsUpperLimit)
		{
			InitializeComponent();
			//
      random = gcnew Random;
  lottoLimitsDialog = gcnew LottoLimitsDialog;
  lottoLimitsDialog->SetLowerLimitsList(1, lottoUpperLimit-lottoValuesCount+1,
                                                                 lottoUserMinimum);
  lottoLimitsDialog->SetUpperLimitsList(lottoValuesCount, lottoUpperLimit,
                                                                 lottoUserMaximum);
  euroLimitsDialog = gcnew EuroLimitsDialog;
  euroLimitsDialog->LowerStarsLimit = euroStarsLowerLimit;
  euroLimitsDialog->UpperStarsLimit = euroStarsUpperLimit;
  userValueDialog = gcnew UserValueDialog;
  //
		}

	protected:
		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		~Form1()
		{
			if (components)
			{
				delete components;
			}
		}
  private: System::Windows::Forms::MenuStrip^  menuStrip1;
  private: System::Windows::Forms::ToolStripMenuItem^  playMenuItem;
  protected: 

  private: System::Windows::Forms::ToolStripMenuItem^  limitsToolStripMenuItem;
  private: System::Windows::Forms::ToolStripMenuItem^  helpToolStripMenuItem;
  private: System::Windows::Forms::ToolStripMenuItem^  upperMenuItem;
  private: System::Windows::Forms::ToolStripMenuItem^  lowerMenuItem;
  private: System::Windows::Forms::ToolStripMenuItem^  resetMenuItem;
  private: System::Windows::Forms::ToolStripMenuItem^  aboutMenuItem;
  private: System::Windows::Forms::TabControl^  tabControl1;
  private: System::Windows::Forms::TabPage^  lottoTab;
  private: System::Windows::Forms::TabPage^  euroTab;
  private: System::Windows::Forms::TabPage^  webTab;
  private: System::Windows::Forms::GroupBox^  lottoValues;
  private: System::Windows::Forms::SplitContainer^  euroEntry;
  private: System::Windows::Forms::GroupBox^  euroValues;
  private: System::Windows::Forms::GroupBox^  euroStars;
  private: System::Windows::Forms::Button^  euroValue4;

  private: System::Windows::Forms::Button^  euroValue1;
  private: System::Windows::Forms::Button^  euroValue3;
  private: System::Windows::Forms::Button^  euroValue5;



  private: System::Windows::Forms::Button^  euroValue2;
  private: System::Windows::Forms::Button^  euroStar2;


  private: System::Windows::Forms::Button^  euroStar1;
  private: System::Windows::Forms::Button^  lottoValue6;
  private: System::Windows::Forms::Button^  lottoValue5;
  private: System::Windows::Forms::Button^  lottoValue4;
  private: System::Windows::Forms::Button^  lottoValue3;
  private: System::Windows::Forms::Button^  lottoValue2;








  private: System::Windows::Forms::Button^  lottoValue1;
  private: System::Windows::Forms::WebBrowser^  webBrowser;
  private: System::Windows::Forms::ContextMenuStrip^  buttonContextMenu;
  private: System::Windows::Forms::ToolStripMenuItem^  chooseValue;
  private: System::ComponentModel::IContainer^  components;











	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->menuStrip1 = (gcnew System::Windows::Forms::MenuStrip());
      this->playMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->limitsToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->upperMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->lowerMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->resetMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->helpToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->aboutMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->tabControl1 = (gcnew System::Windows::Forms::TabControl());
      this->lottoTab = (gcnew System::Windows::Forms::TabPage());
      this->lottoValues = (gcnew System::Windows::Forms::GroupBox());
      this->lottoValue6 = (gcnew System::Windows::Forms::Button());
      this->buttonContextMenu = (gcnew System::Windows::Forms::ContextMenuStrip(this->components));
      this->chooseValue = (gcnew System::Windows::Forms::ToolStripMenuItem());
      this->lottoValue5 = (gcnew System::Windows::Forms::Button());
      this->lottoValue4 = (gcnew System::Windows::Forms::Button());
      this->lottoValue3 = (gcnew System::Windows::Forms::Button());
      this->lottoValue2 = (gcnew System::Windows::Forms::Button());
      this->lottoValue1 = (gcnew System::Windows::Forms::Button());
      this->euroTab = (gcnew System::Windows::Forms::TabPage());
      this->euroEntry = (gcnew System::Windows::Forms::SplitContainer());
      this->euroValues = (gcnew System::Windows::Forms::GroupBox());
      this->euroValue3 = (gcnew System::Windows::Forms::Button());
      this->euroValue5 = (gcnew System::Windows::Forms::Button());
      this->euroValue4 = (gcnew System::Windows::Forms::Button());
      this->euroValue2 = (gcnew System::Windows::Forms::Button());
      this->euroValue1 = (gcnew System::Windows::Forms::Button());
      this->euroStars = (gcnew System::Windows::Forms::GroupBox());
      this->euroStar2 = (gcnew System::Windows::Forms::Button());
      this->euroStar1 = (gcnew System::Windows::Forms::Button());
      this->webTab = (gcnew System::Windows::Forms::TabPage());
      this->webBrowser = (gcnew System::Windows::Forms::WebBrowser());
      this->menuStrip1->SuspendLayout();
      this->tabControl1->SuspendLayout();
      this->lottoTab->SuspendLayout();
      this->lottoValues->SuspendLayout();
      this->buttonContextMenu->SuspendLayout();
      this->euroTab->SuspendLayout();
      this->euroEntry->Panel1->SuspendLayout();
      this->euroEntry->Panel2->SuspendLayout();
      this->euroEntry->SuspendLayout();
      this->euroValues->SuspendLayout();
      this->euroStars->SuspendLayout();
      this->webTab->SuspendLayout();
      this->SuspendLayout();
      // 
      // menuStrip1
      // 
      this->menuStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->playMenuItem, this->limitsToolStripMenuItem, 
        this->helpToolStripMenuItem});
      this->menuStrip1->Location = System::Drawing::Point(0, 0);
      this->menuStrip1->Name = L"menuStrip1";
      this->menuStrip1->Size = System::Drawing::Size(474, 24);
      this->menuStrip1->TabIndex = 0;
      this->menuStrip1->Text = L"menuStrip1";
      // 
      // playMenuItem
      // 
      this->playMenuItem->Name = L"playMenuItem";
      this->playMenuItem->Size = System::Drawing::Size(39, 20);
      this->playMenuItem->Text = L"&Play";
      this->playMenuItem->ToolTipText = L"Create new set of values";
      this->playMenuItem->Click += gcnew System::EventHandler(this, &Form1::playMenuItem_Click);
      // 
      // limitsToolStripMenuItem
      // 
      this->limitsToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(3) {this->upperMenuItem, 
        this->lowerMenuItem, this->resetMenuItem});
      this->limitsToolStripMenuItem->Name = L"limitsToolStripMenuItem";
      this->limitsToolStripMenuItem->Size = System::Drawing::Size(45, 20);
      this->limitsToolStripMenuItem->Text = L"&Limits";
      // 
      // upperMenuItem
      // 
      this->upperMenuItem->Name = L"upperMenuItem";
      this->upperMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>(((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Alt) 
        | System::Windows::Forms::Keys::U));
      this->upperMenuItem->Size = System::Drawing::Size(174, 22);
      this->upperMenuItem->Text = L"Upper";
      this->upperMenuItem->ToolTipText = L"Set upper limit for values";
      this->upperMenuItem->Click += gcnew System::EventHandler(this, &Form1::upperMenuItem_Click);
      // 
      // lowerMenuItem
      // 
      this->lowerMenuItem->Name = L"lowerMenuItem";
      this->lowerMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>(((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Alt) 
        | System::Windows::Forms::Keys::L));
      this->lowerMenuItem->Size = System::Drawing::Size(174, 22);
      this->lowerMenuItem->Text = L"Lower";
      this->lowerMenuItem->ToolTipText = L"Set lower limits for values";
      this->lowerMenuItem->Click += gcnew System::EventHandler(this, &Form1::lowerMenuItem_Click);
      // 
      // resetMenuItem
      // 
      this->resetMenuItem->Name = L"resetMenuItem";
      this->resetMenuItem->ShortcutKeys = static_cast<System::Windows::Forms::Keys>(((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::Alt) 
        | System::Windows::Forms::Keys::R));
      this->resetMenuItem->Size = System::Drawing::Size(174, 22);
      this->resetMenuItem->Text = L"Reset";
      this->resetMenuItem->ToolTipText = L"Reset limits to original values";
      this->resetMenuItem->Click += gcnew System::EventHandler(this, &Form1::resetMenuItem_Click);
      // 
      // helpToolStripMenuItem
      // 
      this->helpToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->aboutMenuItem});
      this->helpToolStripMenuItem->Name = L"helpToolStripMenuItem";
      this->helpToolStripMenuItem->Size = System::Drawing::Size(40, 20);
      this->helpToolStripMenuItem->Text = L"&Help";
      // 
      // aboutMenuItem
      // 
      this->aboutMenuItem->Name = L"aboutMenuItem";
      this->aboutMenuItem->Size = System::Drawing::Size(114, 22);
      this->aboutMenuItem->Text = L"About";
      this->aboutMenuItem->Click += gcnew System::EventHandler(this, &Form1::aboutMenuItem_Click);
      // 
      // tabControl1
      // 
      this->tabControl1->Controls->Add(this->lottoTab);
      this->tabControl1->Controls->Add(this->euroTab);
      this->tabControl1->Controls->Add(this->webTab);
      this->tabControl1->Dock = System::Windows::Forms::DockStyle::Fill;
      this->tabControl1->Location = System::Drawing::Point(0, 24);
      this->tabControl1->Name = L"tabControl1";
      this->tabControl1->SelectedIndex = 0;
      this->tabControl1->Size = System::Drawing::Size(474, 268);
      this->tabControl1->TabIndex = 1;
      // 
      // lottoTab
      // 
      this->lottoTab->Controls->Add(this->lottoValues);
      this->lottoTab->Location = System::Drawing::Point(4, 22);
      this->lottoTab->Name = L"lottoTab";
      this->lottoTab->Padding = System::Windows::Forms::Padding(3);
      this->lottoTab->Size = System::Drawing::Size(466, 242);
      this->lottoTab->TabIndex = 0;
      this->lottoTab->Text = L"Lotto";
      this->lottoTab->UseVisualStyleBackColor = true;
      // 
      // lottoValues
      // 
      this->lottoValues->Controls->Add(this->lottoValue6);
      this->lottoValues->Controls->Add(this->lottoValue5);
      this->lottoValues->Controls->Add(this->lottoValue4);
      this->lottoValues->Controls->Add(this->lottoValue3);
      this->lottoValues->Controls->Add(this->lottoValue2);
      this->lottoValues->Controls->Add(this->lottoValue1);
      this->lottoValues->Dock = System::Windows::Forms::DockStyle::Fill;
      this->lottoValues->Location = System::Drawing::Point(3, 3);
      this->lottoValues->Name = L"lottoValues";
      this->lottoValues->Size = System::Drawing::Size(460, 236);
      this->lottoValues->TabIndex = 0;
      this->lottoValues->TabStop = false;
      this->lottoValues->Text = L"Values 1 to 49";
      // 
      // lottoValue6
      // 
      this->lottoValue6->BackColor = System::Drawing::Color::SkyBlue;
      this->lottoValue6->ContextMenuStrip = this->buttonContextMenu;
      this->lottoValue6->Location = System::Drawing::Point(313, 127);
      this->lottoValue6->Name = L"lottoValue6";
      this->lottoValue6->Size = System::Drawing::Size(56, 23);
      this->lottoValue6->TabIndex = 0;
      this->lottoValue6->Text = L"6";
      this->lottoValue6->UseVisualStyleBackColor = false;
      this->lottoValue6->Click += gcnew System::EventHandler(this, &Form1::lottoValue_Click);
      // 
      // buttonContextMenu
      // 
      this->buttonContextMenu->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^  >(1) {this->chooseValue});
      this->buttonContextMenu->Name = L"buttonContextMenu";
      this->buttonContextMenu->Size = System::Drawing::Size(153, 48);
      this->buttonContextMenu->Opening += gcnew System::ComponentModel::CancelEventHandler(this, &Form1::buttonContextMenu_Opening);
      // 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -