Application mit Login-Fenster öffnen. (Form1 ist mit MDiContainer)
-
Hallo miteinander
Bin an einem Programm am Programmieren, welches ein Login braucht. Wie und an welcher Stelle definiere ich die Form2 (Anmelde-Form). Ich möchte gerne dieses
Programm (Form1) starten und die Login-Form wird automatisch als startPosition:CenterScreen angezeigt: Mein Form1.h sieht folgendermassen aus:[cpp]
#pragma once#include "NeuerSpieler.h"
#include "Info.h"
#include "Login.h"namespace DARTUNIQUE {
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>
/// Zusammenfassung für Form1
///
/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
/// die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter Ressourcen ändern,
/// das allen RESX-Dateien zugewiesen ist, von denen diese Klasse abhängt.
/// Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
/// arbeiten, die diesem Formular zugewiesen sind.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Konstruktorcode hier hinzufügen.
//
}protected:
/// <summary>
/// Verwendete Ressourcen bereinigen.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::NotifyIcon^ taskleistenIcon;
protected:protected:
private: System::Windows::Forms::MenuStrip^ hauptmenu;
private: System::Windows::Forms::ToolStripMenuItem^ toolStripMenuItem1;
private: System::Windows::Forms::ToolStripMenuItem^ toolStripMenuItem2;
private: System::Windows::Forms::ToolStripMenuItem^ toolStripMenuItem4;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem5;
private: System::Windows::Forms::ToolStripMenuItem^ toolStripMenuItem3;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem6;
private: System::Windows::Forms::ToolStripMenuItem^ seitenansichtToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ druckenToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem7;
private: System::Windows::Forms::ToolStripMenuItem^ beendenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ stammdatenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ spielerToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ lokaleToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ mannschaftenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ extrasToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ suchenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ hilfeToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ inhaltToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ produkteSupportToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem8;
private: System::Windows::Forms::ToolStripMenuItem^ produktRegistrierenToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem9;
private: System::Windows::Forms::ToolStripMenuItem^ infoToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ ligaspielToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ spielerEinlesenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ heimTeamToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ gastTeamToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ mannschaftsAufstellungToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ heimToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ gastToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem10;
private: System::Windows::Forms::ToolStripMenuItem^ ligaspielStartenToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem11;
private: System::Windows::Forms::ToolStripMenuItem^ resultatMeldenToolStripMenuItem;
private: System::Windows::Forms::StatusStrip^ statusStrip1;
private: System::Windows::Forms::ToolStripStatusLabel^ toolStripStatusLabel1;
private: System::Windows::Forms::ToolStripProgressBar^ toolStripProgressBar1;
private: System::Windows::Forms::ToolStripMenuItem^ einstellungenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ spielerHinzufügenToolStripMenuItem;
private: System::Windows::Forms::ToolStripMenuItem^ mannschaftHinzufügenToolStripMenuItem;
private: System::Windows::Forms::ToolStripSeparator^ toolStripMenuItem12;protected:
private: System::ComponentModel::IContainer^ components;private:
/// <summary>
/// Erforderliche Designervariable.
/// </summary>#pragma region Windows Form Designer generated code
/// <summary>
/// Erforderliche Methode für die Designerunterstützung.
/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
/// </summary>
void InitializeComponent(void)
{
this->components = (gcnew System::ComponentModel::Container());
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
this->taskleistenIcon = (gcnew System::Windows::Forms::NotifyIcon(this->components));
this->hauptmenu = (gcnew System::Windows::Forms::MenuStrip());
this->toolStripMenuItem1 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem2 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem4 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem5 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->toolStripMenuItem3 = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem6 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->seitenansichtToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->druckenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem7 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->beendenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->stammdatenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->spielerHinzufügenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->mannschaftHinzufügenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem12 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->spielerToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->lokaleToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->mannschaftenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->ligaspielToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->spielerEinlesenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->heimTeamToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->gastTeamToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->mannschaftsAufstellungToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->heimToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->gastToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem10 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->ligaspielStartenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem11 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->resultatMeldenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->extrasToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->suchenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->einstellungenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->hilfeToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->inhaltToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->produkteSupportToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem8 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->produktRegistrierenToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->toolStripMenuItem9 = (gcnew System::Windows::Forms::ToolStripSeparator());
this->infoToolStripMenuItem = (gcnew System::Windows::Forms::ToolStripMenuItem());
this->statusStrip1 = (gcnew System::Windows::Forms::StatusStrip());
this->toolStripStatusLabel1 = (gcnew System::Windows::Forms::ToolStripStatusLabel());
this->toolStripProgressBar1 = (gcnew System::Windows::Forms::ToolStripProgressBar());
this->hauptmenu->SuspendLayout();
this->statusStrip1->SuspendLayout();
this->SuspendLayout();
//
// taskleistenIcon
//
this->taskleistenIcon->BalloonTipText = L"Dartunique ist bereit.";
this->taskleistenIcon->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"taskleistenIcon.Icon")));
this->taskleistenIcon->Text = L"notifyIcon1";
this->taskleistenIcon->Visible = true;
//
// hauptmenu
//
this->hauptmenu->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(5) {this->toolStripMenuItem1,
this->stammdatenToolStripMenuItem, this->ligaspielToolStripMenuItem, this->extrasToolStripMenuItem, this->hilfeToolStripMenuItem});
this->hauptmenu->Location = System::Drawing::Point(0, 0);
this->hauptmenu->Name = L"hauptmenu";
this->hauptmenu->RenderMode = System::Windows::Forms::ToolStripRenderMode::Professional;
this->hauptmenu->Size = System::Drawing::Size(541, 24);
this->hauptmenu->TabIndex = 1;
this->hauptmenu->Text = L"menuStrip1";
//
// toolStripMenuItem1
//
this->toolStripMenuItem1->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(9) {this->toolStripMenuItem2,
this->toolStripMenuItem4, this->toolStripMenuItem5, this->toolStripMenuItem3, this->toolStripMenuItem6, this->seitenansichtToolStripMenuItem,
this->druckenToolStripMenuItem, this->toolStripMenuItem7, this->beendenToolStripMenuItem});
this->toolStripMenuItem1->Name = L"toolStripMenuItem1";
this->toolStripMenuItem1->Size = System::Drawing::Size(44, 20);
this->toolStripMenuItem1->Text = L"&Datei";
//
// toolStripMenuItem2
//
this->toolStripMenuItem2->Name = L"toolStripMenuItem2";
this->toolStripMenuItem2->ShortcutKeys = System::Windows::Forms::Keys::F1;
this->toolStripMenuItem2->Size = System::Drawing::Size(183, 22);
this->toolStripMenuItem2->Text = L"Neu...";
//
// toolStripMenuItem4
//
this->toolStripMenuItem4->Name = L"toolStripMenuItem4";
this->toolStripMenuItem4->ShortcutKeys = System::Windows::Forms::Keys::F2;
this->toolStripMenuItem4->Size = System::Drawing::Size(183, 22);
this->toolStripMenuItem4->Text = L"Öffnen";
this->toolStripMenuItem4->Click += gcnew System::EventHandler(this, &Form1::toolStripMenuItem4_Click);
//
// toolStripMenuItem5
//
this->toolStripMenuItem5->Name = L"toolStripMenuItem5";
this->toolStripMenuItem5->Size = System::Drawing::Size(180, 6);
//
// toolStripMenuItem3
//
this->toolStripMenuItem3->Name = L"toolStripMenuItem3";
this->toolStripMenuItem3->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::S));
this->toolStripMenuItem3->Size = System::Drawing::Size(183, 22);
this->toolStripMenuItem3->Text = L"Speichern";
//
// toolStripMenuItem6
//
this->toolStripMenuItem6->Name = L"toolStripMenuItem6";
this->toolStripMenuItem6->Size = System::Drawing::Size(180, 6);
//
// seitenansichtToolStripMenuItem
//
this->seitenansichtToolStripMenuItem->Name = L"seitenansichtToolStripMenuItem";
this->seitenansichtToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::T));
this->seitenansichtToolStripMenuItem->Size = System::Drawing::Size(183, 22);
this->seitenansichtToolStripMenuItem->Text = L"Sei&tenansicht";
//
// druckenToolStripMenuItem
//
this->druckenToolStripMenuItem->Name = L"druckenToolStripMenuItem";
this->druckenToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Control | System::Windows::Forms::Keys::P));
this->druckenToolStripMenuItem->Size = System::Drawing::Size(183, 22);
this->druckenToolStripMenuItem->Text = L"Drucken";
//
// toolStripMenuItem7
//
this->toolStripMenuItem7->Name = L"toolStripMenuItem7";
this->toolStripMenuItem7->Size = System::Drawing::Size(180, 6);
//
// beendenToolStripMenuItem
//
this->beendenToolStripMenuItem->Name = L"beendenToolStripMenuItem";
this->beendenToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::B));
this->beendenToolStripMenuItem->Size = System::Drawing::Size(183, 22);
this->beendenToolStripMenuItem->Text = L"&Beenden";
this->beendenToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::beendenToolStripMenuItem_Click);
//
// stammdatenToolStripMenuItem
//
this->stammdatenToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(6) {this->spielerHinzufügenToolStripMenuItem,
this->mannschaftHinzufügenToolStripMenuItem, this->toolStripMenuItem12, this->spielerToolStripMenuItem, this->lokaleToolStripMenuItem,
this->mannschaftenToolStripMenuItem});
this->stammdatenToolStripMenuItem->Name = L"stammdatenToolStripMenuItem";
this->stammdatenToolStripMenuItem->Size = System::Drawing::Size(79, 20);
this->stammdatenToolStripMenuItem->Text = L"&Stammdaten";
//
// spielerHinzufügenToolStripMenuItem
//
this->spielerHinzufügenToolStripMenuItem->Name = L"spielerHinzufügenToolStripMenuItem";
this->spielerHinzufügenToolStripMenuItem->Size = System::Drawing::Size(197, 22);
this->spielerHinzufügenToolStripMenuItem->Text = L"Spieler hinzufügen";
this->spielerHinzufügenToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::spielerHinzufügenToolStripMenuItem_Click);
//
// mannschaftHinzufügenToolStripMenuItem
//
this->mannschaftHinzufügenToolStripMenuItem->Name = L"mannschaftHinzufügenToolStripMenuItem";
this->mannschaftHinzufügenToolStripMenuItem->Size = System::Drawing::Size(197, 22);
this->mannschaftHinzufügenToolStripMenuItem->Text = L"Mannschaft hinzufügen";
//
// toolStripMenuItem12
//
this->toolStripMenuItem12->Name = L"toolStripMenuItem12";
this->toolStripMenuItem12->Size = System::Drawing::Size(194, 6);
//
// spielerToolStripMenuItem
//
this->spielerToolStripMenuItem->Name = L"spielerToolStripMenuItem";
this->spielerToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::E));
this->spielerToolStripMenuItem->Size = System::Drawing::Size(197, 22);
this->spielerToolStripMenuItem->Text = L"Spi&eler";
//
// lokaleToolStripMenuItem
//
this->lokaleToolStripMenuItem->Name = L"lokaleToolStripMenuItem";
this->lokaleToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::L));
this->lokaleToolStripMenuItem->Size = System::Drawing::Size(197, 22);
this->lokaleToolStripMenuItem->Text = L"&Lokale";
//
// mannschaftenToolStripMenuItem
//
this->mannschaftenToolStripMenuItem->Name = L"mannschaftenToolStripMenuItem";
this->mannschaftenToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::N));
this->mannschaftenToolStripMenuItem->Size = System::Drawing::Size(197, 22);
this->mannschaftenToolStripMenuItem->Text = L"Man&nschaften";
//
// ligaspielToolStripMenuItem
//
this->ligaspielToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(6) {this->spielerEinlesenToolStripMenuItem,
this->mannschaftsAufstellungToolStripMenuItem, this->toolStripMenuItem10, this->ligaspielStartenToolStripMenuItem, this->toolStripMenuItem11,
this->resultatMeldenToolStripMenuItem});
this->ligaspielToolStripMenuItem->Name = L"ligaspielToolStripMenuItem";
this->ligaspielToolStripMenuItem->Size = System::Drawing::Size(59, 20);
this->ligaspielToolStripMenuItem->Text = L"Ligaspiel";
//
// spielerEinlesenToolStripMenuItem
//
this->spielerEinlesenToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->heimTeamToolStripMenuItem,
this->gastTeamToolStripMenuItem});
this->spielerEinlesenToolStripMenuItem->Name = L"spielerEinlesenToolStripMenuItem";
this->spielerEinlesenToolStripMenuItem->Size = System::Drawing::Size(204, 22);
this->spielerEinlesenToolStripMenuItem->Text = L"Spieler einlesen";
//
// heimTeamToolStripMenuItem
//
this->heimTeamToolStripMenuItem->Name = L"heimTeamToolStripMenuItem";
this->heimTeamToolStripMenuItem->Size = System::Drawing::Size(138, 22);
this->heimTeamToolStripMenuItem->Text = L"Heim-Team";
//
// gastTeamToolStripMenuItem
//
this->gastTeamToolStripMenuItem->Name = L"gastTeamToolStripMenuItem";
this->gastTeamToolStripMenuItem->Size = System::Drawing::Size(138, 22);
this->gastTeamToolStripMenuItem->Text = L"Gast-Team";
//
// mannschaftsAufstellungToolStripMenuItem
//
this->mannschaftsAufstellungToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->heimToolStripMenuItem,
this->gastToolStripMenuItem});
this->mannschaftsAufstellungToolStripMenuItem->Name = L"mannschaftsAufstellungToolStripMenuItem";
this->mannschaftsAufstellungToolStripMenuItem->Size = System::Drawing::Size(204, 22);
this->mannschaftsAufstellungToolStripMenuItem->Text = L"Mannschafts-Aufstellung";
//
// heimToolStripMenuItem
//
this->heimToolStripMenuItem->Name = L"heimToolStripMenuItem";
this->heimToolStripMenuItem->Size = System::Drawing::Size(108, 22);
this->heimToolStripMenuItem->Text = L"Heim";
//
// gastToolStripMenuItem
//
this->gastToolStripMenuItem->Name = L"gastToolStripMenuItem";
this->gastToolStripMenuItem->Size = System::Drawing::Size(108, 22);
this->gastToolStripMenuItem->Text = L"Gast";
//
// toolStripMenuItem10
//
this->toolStripMenuItem10->Name = L"toolStripMenuItem10";
this->toolStripMenuItem10->Size = System::Drawing::Size(201, 6);
//
// ligaspielStartenToolStripMenuItem
//
this->ligaspielStartenToolStripMenuItem->Enabled = false;
this->ligaspielStartenToolStripMenuItem->Name = L"ligaspielStartenToolStripMenuItem";
this->ligaspielStartenToolStripMenuItem->Size = System::Drawing::Size(204, 22);
this->ligaspielStartenToolStripMenuItem->Text = L"Ligaspiel starten";
//
// toolStripMenuItem11
//
this->toolStripMenuItem11->Name = L"toolStripMenuItem11";
this->toolStripMenuItem11->Size = System::Drawing::Size(201, 6);
//
// resultatMeldenToolStripMenuItem
//
this->resultatMeldenToolStripMenuItem->Enabled = false;
this->resultatMeldenToolStripMenuItem->Name = L"resultatMeldenToolStripMenuItem";
this->resultatMeldenToolStripMenuItem->Size = System::Drawing::Size(204, 22);
this->resultatMeldenToolStripMenuItem->Text = L"Resultat melden";
//
// extrasToolStripMenuItem
//
this->extrasToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->suchenToolStripMenuItem,
this->einstellungenToolStripMenuItem});
this->extrasToolStripMenuItem->Name = L"extrasToolStripMenuItem";
this->extrasToolStripMenuItem->Size = System::Drawing::Size(50, 20);
this->extrasToolStripMenuItem->Text = L"E&xtras";
//
// suchenToolStripMenuItem
//
this->suchenToolStripMenuItem->Name = L"suchenToolStripMenuItem";
this->suchenToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::F1));
this->suchenToolStripMenuItem->Size = System::Drawing::Size(220, 22);
this->suchenToolStripMenuItem->Text = L"Suchen / Statistiken";
//
// einstellungenToolStripMenuItem
//
this->einstellungenToolStripMenuItem->Name = L"einstellungenToolStripMenuItem";
this->einstellungenToolStripMenuItem->Size = System::Drawing::Size(220, 22);
this->einstellungenToolStripMenuItem->Text = L"Einstellungen";
//
// hilfeToolStripMenuItem
//
this->hilfeToolStripMenuItem->DropDownItems->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(6) {this->inhaltToolStripMenuItem,
this->produkteSupportToolStripMenuItem, this->toolStripMenuItem8, this->produktRegistrierenToolStripMenuItem, this->toolStripMenuItem9,
this->infoToolStripMenuItem});
this->hilfeToolStripMenuItem->Name = L"hilfeToolStripMenuItem";
this->hilfeToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::I));
this->hilfeToolStripMenuItem->Size = System::Drawing::Size(40, 20);
this->hilfeToolStripMenuItem->Text = L"H&ilfe";
//
// inhaltToolStripMenuItem
//
this->inhaltToolStripMenuItem->Name = L"inhaltToolStripMenuItem";
this->inhaltToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::H));
this->inhaltToolStripMenuItem->Size = System::Drawing::Size(217, 22);
this->inhaltToolStripMenuItem->Text = L"In&halt";
//
// produkteSupportToolStripMenuItem
//
this->produkteSupportToolStripMenuItem->Name = L"produkteSupportToolStripMenuItem";
this->produkteSupportToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::S));
this->produkteSupportToolStripMenuItem->Size = System::Drawing::Size(217, 22);
this->produkteSupportToolStripMenuItem->Text = L"Produkte Support";
//
// toolStripMenuItem8
//
this->toolStripMenuItem8->Name = L"toolStripMenuItem8";
this->toolStripMenuItem8->Size = System::Drawing::Size(214, 6);
//
// produktRegistrierenToolStripMenuItem
//
this->produktRegistrierenToolStripMenuItem->Name = L"produktRegistrierenToolStripMenuItem";
this->produktRegistrierenToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys::P));
this->produktRegistrierenToolStripMenuItem->Size = System::Drawing::Size(217, 22);
this->produktRegistrierenToolStripMenuItem->Text = L"Prod&ukt Registrieren";
//
// toolStripMenuItem9
//
this->toolStripMenuItem9->Name = L"toolStripMenuItem9";
this->toolStripMenuItem9->Size = System::Drawing::Size(214, 6);
//
// infoToolStripMenuItem
//
this->infoToolStripMenuItem->Name = L"infoToolStripMenuItem";
this->infoToolStripMenuItem->ShortcutKeys = static_castSystem::Windows::Forms::Keys((System::Windows::Forms::Keys::Alt | System::Windows::Forms::Keys:);
this->infoToolStripMenuItem->Size = System::Drawing::Size(217, 22);
this->infoToolStripMenuItem->Text = L"Inf&o";
this->infoToolStripMenuItem->Click += gcnew System::EventHandler(this, &Form1::infoToolStripMenuItem_Click);
//
// statusStrip1
//
this->statusStrip1->Items->AddRange(gcnew cli::array< System::Windows::Forms::ToolStripItem^ >(2) {this->toolStripStatusLabel1,
this->toolStripProgressBar1});
this->statusStrip1->Location = System::Drawing::Point(0, 337);
this->statusStrip1->Name = L"statusStrip1";
this->statusStrip1->Size = System::Drawing::Size(541, 22);
this->statusStrip1->TabIndex = 3;
this->statusStrip1->Text = L"statusStrip1";
//
// toolStripStatusLabel1
//
this->toolStripStatusLabel1->Margin = System::Windows::Forms::Padding(0, 3, 15, 2);
this->toolStripStatusLabel1->Name = L"toolStripStatusLabel1";
this->toolStripStatusLabel1->Size = System::Drawing::Size(60, 17);
this->toolStripStatusLabel1->Text = L"Dartunique";
//
// toolStripProgressBar1
//
this->toolStripProgressBar1->Name = L"toolStripProgressBar1";
this->toolStripProgressBar1->Size = System::Drawing::Size(100, 16);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::Silver;
this->ClientSize = System::Drawing::Size(541, 359);
this->Controls->Add(this->statusStrip1);
this->Controls->Add(this->hauptmenu);
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
this->IsMdiContainer = true;
this->MainMenuStrip = this->hauptmenu;
this->Name = L"Form1";
this->Text = L"DARTUNIQUE (Professional Dart League Trophy) PDLT";
this->WindowState = System::Windows::Forms::FormWindowState::Maximized;
this->hauptmenu->ResumeLayout(false);
this->hauptmenu->PerformLayout();
this->statusStrip1->ResumeLayout(false);
this->statusStrip1->PerformLayout();
this->ResumeLayout(false);
this->PerformLayout();}
#pragma endregion
private: System::Void toolStripMenuItem4_Click(System::Object^ sender, System::EventArgs^ e) {
//we use OpenFileDialog to show a file-open dialog box
OpenFileDialog CommonDialog;
CommonDialog.Title = "Zuletzt gespeicherte Daten";CommonDialog.Multiselect = true;
CommonDialog.CheckFileExists = true;
CommonDialog.Filter = "Backup File (.dqe)|.dqe";
CommonDialog.FilterIndex = 2;//if user has clicked on the OK button
if(CommonDialog.ShowDialog()== System::Windows::Forms::DialogResult::OK)
{ // do something here
}}
private: System::Void spielerHinzufügenToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
NeuerSpieler^ newMDIChild = gcnew NeuerSpieler();
// Set the Parent Form of the Child window.
newMDIChild->MdiParent = this;
// Display the new form.
newMDIChild->Show();
}
private: System::Void beendenToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
Application::Exit();
}
private: System::Void infoToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) {
Info^ newMDIChild = gcnew Info();
// Set the Parent Form of the Child window.
newMDIChild->MdiParent = this;
// Display the new form.
newMDIChild->Show();
}
};
}
-
private: System::Void toolStripMenuItem4_Click(System::Object^ sender, System::EventArgs^ e) { //we use OpenFileDialog to show a file-open dialog box OpenFileDialog CommonDialog; CommonDialog.Title = "Zuletzt gespeicherte Daten"; CommonDialog.Multiselect = true; CommonDialog.CheckFileExists = true; CommonDialog.Filter = "Backup File (*.dqe)|*.dqe"; CommonDialog.FilterIndex = 2; //if user has clicked on the OK button if(CommonDialog.ShowDialog()== System::Windows::Forms::DialogResult::OK) { // do something here } } private: System::Void spielerHinzufügenToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { NeuerSpieler^ newMDIChild = gcnew NeuerSpieler(); // Set the Parent Form of the Child window. newMDIChild->MdiParent = this; // Display the new form. newMDIChild->Show(); } private: System::Void beendenToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { Application::Exit(); } private: System::Void infoToolStripMenuItem_Click(System::Object^ sender, System::EventArgs^ e) { Info^ newMDIChild = gcnew Info(); // Set the Parent Form of the Child window. newMDIChild->MdiParent = this; // Display the new form. newMDIChild->Show(); }
nächstes mal reicht das wohl vollkommend...
Ich hab deinen Code nur kurz überlflogen und etwas gefunden
OpenFileDialog CommonDialog; CommonDialog.Title = "Zuletzt gespeicherte Daten"; CommonDialog.Multiselect = true; CommonDialog.CheckFileExists = true; CommonDialog.Filter = "Backup File (*.dqe)|*.dqe"; CommonDialog.FilterIndex = 2;
und zwar heißt das:
OpenFileDialog^ CommonDialog = gcnew OpenFileDialog(); CommonDialog->Title = "Zuletzt gespeicherte Daten"; CommonDialog->Multiselect = true; CommonDialog->CheckFileExists = true; CommonDialog->Filter = "Backup File (*.dqe)|*.dqe"; CommonDialog->FilterIndex = 2;
Der Code ist nicht überprüft!!
Und erkläre mal dein Problem man kann aus deinem Text verstehe ich dein Problem nicht. Gibts ne Fehlermeldung??
-
Hallo
Ja im Prinzip hast Du ja recht mit deinem Argument, dass ich die "halbe" Lösung schon im Quelltext habe. Nur: Ich möchte dieses automatisiert haben. Ich meine die Anmelde-Form (Form2) soll eben halt automatisch erscheinen mit Form1 Zusammen.
Kannst Du mir dabei ein bisschen unter die Arme greifen?
Danke schon im Vorraus
-
Fehlermeldungen gibts zum Glück noch nicht
-
... Ich weiss nicht, wo ich diesen "Befehl" einbinden muss...
-
Dann mach ein Event bei Form1 Shown glaub ich heißt das und in dem setzt du dann
Form2 ^form = gcnew Form2(); form->Show(); oder form->ShowDialog() // falls erst was bei Form2 erledigt werden muss
-
...
Hat geklappt. Dankeschön. Musste nur noch die TopMost-Eigenschaft auf "true" stellen.
Danke für Deine Hilfe.
Gruss