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

C#

 
AnswerRe: Calling external application with arbitary input parameters Pin
Christian Graus30-Jan-07 18:37
protectorChristian Graus30-Jan-07 18:37 
AnswerRe: Calling external application with arbitary input parameters Pin
Tyler4530-Jan-07 18:48
Tyler4530-Jan-07 18:48 
AnswerRe: Calling external application with arbitary input parameters Pin
Martin#30-Jan-07 19:13
Martin#30-Jan-07 19:13 
GeneralRe: Calling external application with arbitary input parameters Pin
Eyungwah31-Jan-07 6:40
Eyungwah31-Jan-07 6:40 
QuestionRe: Calling external application with arbitary input parameters Pin
Eyungwah31-Jan-07 7:28
Eyungwah31-Jan-07 7:28 
AnswerRe: Calling external application with arbitary input parameters Pin
Martin#31-Jan-07 10:24
Martin#31-Jan-07 10:24 
QuestionRe: Calling external application with arbitary input parameters Pin
Eyungwah31-Jan-07 12:49
Eyungwah31-Jan-07 12:49 
AnswerRe: Calling external application with arbitary input parameters [modified] Pin
Martin#31-Jan-07 22:48
Martin#31-Jan-07 22:48 
Hello,

Is it a question of multi selection?
In this case you should make your code dynamic and hold the references of your TextBoxes in a Hashtable.
private Hashtable AllTextBoxes = new Hashtable();

        //constructor code

    AllTextBoxes.Add(0, textBox1);
    AllTextBoxes.Add(1, textBox2);
                //...
                //You could make it more dynamic with a foreach(Control c in this.Controls), than cast c as Textbox. ...
}

        //button click
private void button2_Click(object sender, System.EventArgs e)
{
    OpenFileDialog dlg = new OpenFileDialog();
                dlg.Multiline = true;
    if (dlg.ShowDialog() == DialogResult.OK)
    {
        for(int x=0;x<AllTextBoxes.Count;x++)
        {
            TextBox actTB = AllTextBoxes[x] as TextBox;
            if(x<dlg.FileNames.Length)
            {
                actTB.Text = dlg.FileNames[x]; //add text
            }
            else
            {
                actTB.Text = ""; //clear text
            }
        }
    }
}


If I didn't understand you right, please let me know.

All the best,

Martin



-- modified at 5:39 Thursday 1st February, 2007
Questionclear all values from text boxes while logging out Pin
Ankit Aneja30-Jan-07 18:07
Ankit Aneja30-Jan-07 18:07 
AnswerRe: clear all values from text boxes while logging out Pin
Ankit Aneja30-Jan-07 18:10
Ankit Aneja30-Jan-07 18:10 
GeneralRe: clear all values from text boxes while logging out Pin
Ankit Aneja30-Jan-07 18:35
Ankit Aneja30-Jan-07 18:35 
AnswerRe: clear all values from text boxes while logging out Pin
Christian Graus30-Jan-07 18:36
protectorChristian Graus30-Jan-07 18:36 
GeneralRe: clear all values from text boxes while logging out Pin
Ankit Aneja30-Jan-07 18:45
Ankit Aneja30-Jan-07 18:45 
AnswerRe: clear all values from text boxes while logging out Pin
Martin#30-Jan-07 19:21
Martin#30-Jan-07 19:21 
Questionreplacement for Thread.Suspend(), Thread.Resume() ? Pin
michal.kreslik30-Jan-07 18:01
michal.kreslik30-Jan-07 18:01 
AnswerRe: replacement for Thread.Suspend(), Thread.Resume() ? Pin
Russell Jones31-Jan-07 0:44
Russell Jones31-Jan-07 0:44 
GeneralRe: replacement for Thread.Suspend(), Thread.Resume() ? Pin
michal.kreslik31-Jan-07 6:47
michal.kreslik31-Jan-07 6:47 
GeneralRe: replacement for Thread.Suspend(), Thread.Resume() ? Pin
Russell Jones31-Jan-07 21:04
Russell Jones31-Jan-07 21:04 
QuestionHelp in developing EMail Client Pin
EEmaan30-Jan-07 17:45
EEmaan30-Jan-07 17:45 
QuestionHelp in Developing EMail Client Pin
EEmaan30-Jan-07 17:37
EEmaan30-Jan-07 17:37 
AnswerRe: Help in Developing EMail Client Pin
Mahernoz30-Jan-07 18:02
Mahernoz30-Jan-07 18:02 
GeneralRe: Help in Developing EMail Client Pin
EEmaan30-Jan-07 20:06
EEmaan30-Jan-07 20:06 
QuestionRegarding ContextSwitchDeadlock Exception Pin
kraj9930-Jan-07 17:30
kraj9930-Jan-07 17:30 
GeneralRe: Regarding ContextSwitchDeadlock Exception Pin
andre_swnpl30-Jan-07 18:48
andre_swnpl30-Jan-07 18:48 
QuestionInvalidActiveXSateException was unhandled- MSChart control 6.0 Pin
GunaChinna30-Jan-07 17:26
GunaChinna30-Jan-07 17:26 

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.