Click here to Skip to main content
15,900,378 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Mycroft Holmes4-Dec-13 21:31
professionalMycroft Holmes4-Dec-13 21:31 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 0:14
_Q12_5-Dec-13 0:14 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Richard MacCutchan5-Dec-13 0:54
mveRichard MacCutchan5-Dec-13 0:54 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 0:58
_Q12_5-Dec-13 0:58 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
OriginalGriff5-Dec-13 1:06
mveOriginalGriff5-Dec-13 1:06 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
_Q12_5-Dec-13 1:18
_Q12_5-Dec-13 1:18 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
HobbyProggy5-Dec-13 3:25
professionalHobbyProggy5-Dec-13 3:25 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Pete O'Hanlon5-Dec-13 21:12
mvePete O'Hanlon5-Dec-13 21:12 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
HobbyProggy5-Dec-13 21:43
professionalHobbyProggy5-Dec-13 21:43 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Pete O'Hanlon5-Dec-13 22:46
mvePete O'Hanlon5-Dec-13 22:46 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
Mycroft Holmes5-Dec-13 1:42
professionalMycroft Holmes5-Dec-13 1:42 
GeneralRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
BBatts5-Dec-13 10:29
BBatts5-Dec-13 10:29 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
OriginalGriff4-Dec-13 21:49
mveOriginalGriff4-Dec-13 21:49 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
DRAYKKO5-Dec-13 7:49
professionalDRAYKKO5-Dec-13 7:49 
AnswerRe: How do i take the text from Form2.textbox and paste it into Form1.textbox? Pin
WuRunZhe9-Dec-13 2:41
WuRunZhe9-Dec-13 2:41 
QuestionCreate excel 97-2003 by Open XML SDK 2.5 ? Pin
emma.sun.sts4-Dec-13 15:36
emma.sun.sts4-Dec-13 15:36 
AnswerRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
Richard MacCutchan4-Dec-13 22:16
mveRichard MacCutchan4-Dec-13 22:16 
GeneralRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
emma.sun.sts8-Dec-13 15:22
emma.sun.sts8-Dec-13 15:22 
GeneralRe: Create excel 97-2003 by Open XML SDK 2.5 ? Pin
Richard MacCutchan8-Dec-13 22:05
mveRichard MacCutchan8-Dec-13 22:05 
Questionhow to read value at specifix XML node Pin
bimbambumbum4-Dec-13 11:10
bimbambumbum4-Dec-13 11:10 
AnswerRe: how to read value at specifix XML node Pin
Jason Gleim4-Dec-13 13:05
professionalJason Gleim4-Dec-13 13:05 
AnswerRe: how to read value at specifix XML node Pin
PIEBALDconsult4-Dec-13 13:34
mvePIEBALDconsult4-Dec-13 13:34 
AnswerRe: how to read value at specifix XML node Pin
HobbyProggy5-Dec-13 4:01
professionalHobbyProggy5-Dec-13 4:01 
Hey bimbambumbum,
that's my way of doing it, with this code you'll get the attributes to your specific node. Code is written for .Net Framework 3.5

Additionaly i posted the XML file so you can backtrace the work and derive your code from it.

All you need to have set up is
the xmlDoc and a xPathNavigator xmlNavi = xmlDoc.createNavi...

C#
public DataTable LoadValueConfig(string ControlName, string ParentName, string FormName)
        {
            DataTable _dt = new DataTable();
            _dt.Columns.Add("Name");
            _dt.Columns.Add("Value");
            
            //Move to root node
            _xmlNavi.MoveToRoot();
            //move to windowConfig Node
            _xmlNavi.MoveTo(_xmlNavi.SelectSingleNode("WindowConfig"));
            //if node of form exists move to it
            if (FormName != "") { _xmlNavi.MoveTo(_xmlNavi.SelectSingleNode(FormName)); }
            //if node of parent exists move to it e.g. bsAdminTest
            _xmlNavi.MoveTo(_xmlNavi.SelectSingleNode(ParentName));
            // if control Name exists move to it e.g. switchButton1
            if (_xmlNavi.MoveTo(_xmlNavi.SelectSingleNode(ControlName)))
            {
                _xmlNavi.MoveTo(_xmlNavi.SelectSingleNode(ControlName));
                //Move to first attribute
                _xmlNavi.MoveToFirstAttribute();
                // move through all Attributes and save the values into the DataTable
                do
                {
                    if (_xmlNavi.Value != "")
                    {
                        _dt.Rows.Add(_xmlNavi.Name, _xmlNavi.Value);
                    }
                // while able to move to next Attribute
                } while(_xmlNavi.MoveToNextAttribute());
            }
            
            return _dt;
        }


XML File:

XML
<WindowConfig>
  <kopiefrmHauptfenster Position="460:21" Size="878:1170" WindowState="Normal">
    <checkBoxItem1 chBoxCheck="True" />
    <bsAdminTest Active="False">
      <switchButton1 switch="False" />
      <richTextBoxEx1 Text="" />
    </bsAdminTest>
    <Project Active="True">
      <navigationPane1 CheckedButton="Projekte" Expanded="True" />
      <expandablePanel1 Expanded="True" />
    </Project>
  </kopiefrmHauptfenster>
</WindowConfig>


Edit: added the comments for more Explanation

Ist probably not the best and most comfortable solution but int works for me, optimizations appreciated
if(this.signature != "")
{
MessageBox.Show("This is my signature: " + Environment.NewLine + signature);
}
else
{
MessageBox.Show("404-Signature not found");
}


modified 5-Dec-13 10:13am.

GeneralRe: how to read value at specifix XML node Pin
bimbambumbum5-Dec-13 7:19
bimbambumbum5-Dec-13 7:19 
QuestionPlease answer it is my biggest problem. Pin
Tera Mind4-Dec-13 10:59
professionalTera Mind4-Dec-13 10:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.