Autor Beitrag
schani
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 39



BeitragVerfasst: Mi 15.08.07 12:35 
hi, ich hab mal wieder ein Problem, welches ich löschen möchte.


Folgendes:
Ich habe 2 Forms, in Form1 wird ein benutzername eingegeben.
Jetzt kann der User einen Button klicken wodurch sich Form2 öffnet.
In Form2 ist ein Webbrowser der eine URL aufruft, dieser URL soll der Benutzername aus form1
mitgegeben werden.

Wie mache ich das jetzt genau, ich muss ja praktisch eine Art Globale Variable haben oder?

Schani
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Mi 15.08.07 12:59 
Da du die zweite Form wohl in der ersten erstellst, übergebe den Benutzernamen gleich dem Form2-Konstruktor - einfacher geht es nicht mehr.
schani Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 39



BeitragVerfasst: Mi 15.08.07 13:19 
sorry für die dumme Frage, aber wie mach ich das,
bin ja noch anfängerin in c#!
Kha
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 3803
Erhaltene Danke: 176

Arch Linux
Python, C, C++ (vim)
BeitragVerfasst: Mi 15.08.07 13:44 
IM Galileo-OpenBook findest du Konstruktoren unter 4.5.
ausblenden C#-Quelltext
1:
2:
3:
4:
public Form2(string userName) : this() // Standardkonstruktor aufrufen, der den essentiellen InitializeComponent-Aufruf enthält
{
  ...
}
schani Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 39



BeitragVerfasst: Mi 15.08.07 16:20 
wo muss ich das jetzt hinschreiben, verstehe das nicht so wirklich!
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 15.08.07 16:23 
Hallo!

Du hast ja das Kapitel des OpenBook gelesen, welches Khabarakh verlinkt hat. Was hast Du daraufhin ausprobiert?

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
schani Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 39



BeitragVerfasst: Mi 15.08.07 17:02 
garnichts, weil ich es nicht verstehe...
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 15.08.07 17:19 
Dann sag doch, was Du im OpenBook nicht verstehst und wir schauen, dass wir es Dir erklären.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".