Autor Beitrag
Azzidodabass
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: So 23.11.08 14:36 
Hallo an alle,

möchte mit Datei Neu ein neues Formular öffnen, wobei in diesem Formular beim Starten ein Unterformular geöffnet werden soll, das erst ausgefüllt werden muss, geschlossen werden muss und dann erst kann ich an das Hauptformular ran.

Hoffe ich hab mich verständlich ausgedrückt.

Öffnen der beiden Formulare klappt, aber wie heisst die Eigenschaft, dass das unterformular, wie bei einer messagebox immer oberste priorität hat und erst bearbeitet und geschlossen werden muss??
danke schonmal
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: So 23.11.08 14:48 
Benutze zum Öffnen der zweiten Form ShowDialog.

_________________
>λ=
JüTho
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2021
Erhaltene Danke: 6

Win XP Prof
C# 2.0 (#D für NET 2.0, dazu Firebird); früher Delphi 5 und Delphi 2005 Pro
BeitragVerfasst: So 23.11.08 16:39 
@Azzidodabass
Zur Antwort auf Deine Hauptfrage weise ich auf die SDK-Doku/MSDN hin: Schau die Eigenschaften der Form-Klasse (WinForms) an, was dem entspricht. Dann wirst Du diese Beschreibung finden:
Zitat:
Ruft einen Wert ab, der angibt, ob das Formular als oberstes Formular angezeigt werden soll, oder legt diesen fest.

Das wäre die Antwort auf Deine Frage. Aber diese Lösung wäre äußerst unpraktisch, weil damit auch jedes andere Fenster jeder anderen Anwendung überlagert würde. Deshalb ist Kha's Antwort besser.

Wenn es um ein Login-Formular oder um einen SplashScreen geht, dann musst Du Dein Vorgehen ändern. In die Main-Methode von Program.cs gehört etwas wie folgt:
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
MainForm main = null;
using( SplashScreen splash = new SplashScreen() )
{
   splash.Show();
   //  MainForm mit der Start-Einstellung "not visible"
   main = new MainForm();
   main.Init();
   splash.Hide();
}
if (main != null)
   Application.Run(main);

Unklarheiten bitte in der SDK-Doku/MSDN nachlesen. Jürgen
Azzidodabass Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: So 23.11.08 19:19 
Super Dankeschön für die ausführliche Antwort.