Autor Beitrag
SSC streezer
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 110

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Do 03.07.08 09:03 
Hallo - schon wieder ich ;)

ich möchte via Konfigurations Form in einer Textbox den lokalen Pfad eines Treeviews festlegen.

wie mach ich das nun dass ich den inhalt des textfeldes auf dem konf. form an das hauptform. geben kann?

habs mal mit get / set methoden versucht, aber das klappt irgendwie nicht...

des weiteren muss ich noch beachten dass der treeview neu geladen werden muss, wenn das konf. form geschlossen wird (da sich der pfad ja ändert - evtl.)

könnt ihr mir da irgendwelche Hints geben?


gruss,
streezer


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (.NET) verschoben am Do 03.07.2008 um 10:17

_________________
>> Swiss Soldiers Clan << visit us
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 03.07.08 10:20 

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

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Do 03.07.08 10:41 
mmmok... danke schön...

aber wenn ich vom textfeld den inhalt in eine variable im hauptform laden möchte... funzt das nicht so... :s oder hab ich da was vergessen?

im moment hab ich das so gelöst:

string m_path = getPfad();

aber das klappt eben nciht so ganz...

_________________
>> Swiss Soldiers Clan << visit us
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 03.07.08 10:44 
Sorry, aber mit der einen Zeile Quelltext kann ich nix anfangen :nixweiss:

Generell habe ich den Eindruck, dass Du Dir ein bisschen mehr Mühe bei Deinen Postings geben könntest :zwinker:

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

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Do 03.07.08 11:40 
ja wie will man mehr infos geben wenn man keine ahnung hat? xD

konfigurations form
ausblenden C#-Quelltext
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:
public partial class Konfiguration : Form
    {
        public string m_path;
        public Konfiguration()
        {
            InitializeComponent();
            txt_path.Text = m_path;
        }

        private void btn_ok_Click(object sender, EventArgs e)
        {
            setPfad(txt_path.Text);
            this.DialogResult = DialogResult.OK;
        }

        private void btn_abort_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Abort;
        }

        public void setPfad(string path)
        {
            txt_path.Text = path;
        }

        public string getPfad()
        {
            return txt_path.Text;
        }
    }


hauptform
ausblenden C#-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
public partial class Hauptformular : Form
    {
        public string m_path;
        private System.Windows.Forms.TreeView treeDir;

        string substringDirectory;
        string substringFile;

        public Hauptformular()
        {
            InitializeComponent();
            treeDir.Nodes.Clear();
            m_path = @"C:\Dokumente und Einstellungen\bam\Eigene Dateien";
            treeDir.Nodes.Add(m_path);
            ErstelleDirTreeviewDir(m_path, treeDir.Nodes[0]);

            treeDir.AllowDrop = true;
            treeFile.AllowDrop = true;
        }

_________________
>> Swiss Soldiers Clan << visit us
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 03.07.08 11:47 
user profile iconSSC streezer hat folgendes geschrieben:
ja wie will man mehr infos geben wenn man keine ahnung hat? xD

Du könntest z.B. sagen, was "klappt nicht" denn bedeutet ;-)

Und irgendwie sehe ich nicht, wo Du denn Konfiguration überhaupt benutzt :lupe:

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

WinXP, Vista Ultimate
C# (VS 05 n' 08), PHP
BeitragVerfasst: Do 03.07.08 12:34 
ja die übergabe des inhalts der textbox wird nicht übergeben an das haupformular...

ja ich hab ja auch noch nix gemacht weil ich nicht weiss wie man das machen kann :S

_________________
>> Swiss Soldiers Clan << visit us
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Do 03.07.08 12:47 
user profile iconSSC streezer hat folgendes geschrieben:
ja ich hab ja auch noch nix gemacht weil ich nicht weiss wie man das machen kann :S
Öhm. Dann ist es kein Wunder, dass nichts übergeben wird, wenn Du nichts machst? Ich würde sagen, Du probierst das jetzt erst einmal. So schwer ist das nicht, wenn Du den Link anschaust, den ich Dir gegeben habe.

Wenn Du dann was konkreteres hast, kannste ja nochmal nachfragen.

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