Click here to Skip to main content
15,911,139 members
Home / Discussions / C#
   

C#

 
QuestionNew in .NET 2.0 Pin
Blumen17-May-07 3:20
Blumen17-May-07 3:20 
AnswerRe: New in .NET 2.0 Pin
Christian Graus17-May-07 3:22
protectorChristian Graus17-May-07 3:22 
GeneralRe: New in .NET 2.0 Pin
Blumen17-May-07 3:27
Blumen17-May-07 3:27 
GeneralRe: New in .NET 2.0 Pin
Christian Graus17-May-07 3:30
protectorChristian Graus17-May-07 3:30 
GeneralRe: New in .NET 2.0 Pin
Judah Gabriel Himango17-May-07 5:18
sponsorJudah Gabriel Himango17-May-07 5:18 
AnswerRe: New in .NET 2.0 Pin
Russell Jones17-May-07 3:52
Russell Jones17-May-07 3:52 
AnswerRe: New in .NET 2.0 Pin
Nissim Salomon17-May-07 5:24
Nissim Salomon17-May-07 5:24 
Questionhow to get textbox control? Pin
newtocsharp17-May-07 3:14
newtocsharp17-May-07 3:14 
Hi,

I am trying to create a notepad with tabs. I have now run into problems and need some help. My problem is that when i want to open a file into a tab, i dont know which textbox to open in? Each tabpage has a rih textbox as a control. I cant figure out how to get the individual texbox control back.

Here is the code i am trying with sofar:

while ((read = content.ReadLine()) != null)
            {
                //int i = tabControl1.TabPages.IndexOf(tabControl1.SelectedTab);
                //rTextBox.TabIndex = i;
                foreach (Control contr in newtabpage.Controls)
                {
                    if (contr.GetType() == typeof(RichTextBox))
                    {
                        for (int j = 1; j < newtabpage.Controls.Count; j++)
                        {
                            if (rTextBox.Name == "rbox2" /*+ tabControl1.TabPages.IndexOf(tabControl1.SelectedTab)*/)
                            {
                                rTextBox.Text += read + "\n";
                                break;
                            }
                        }
                    }
                }
              rTextBox.Text += read + "\n";
            }
            tabControl1.SelectedTab.Text = filename;
            content.Close();


This is the code i use when a new tab is created:

rTextBox = new RichTextBox();
            rTextBox.Dock = DockStyle.Fill;
            rTextBox.Name = "rbox" + tabControl1.TabCount.ToString();
            //MessageBox.Show(rTextBox.Name);
            

            newtabpage = new TabPage();
            
            newtabpage.Controls.Add(rTextBox);
            String tn = "ntab" + tabControl1.TabCount.ToString();
            newtabpage.Name = tn;
            tabControl1.TabPages.Add(newtabpage);
            newtabpage.Text = tn;// "newfile" + tabControl1.TabCount.ToString();
            tabControl1.SelectedTab = newtabpage;


I would be glad if anybody could help me with this. Thanks.
AnswerRe: how to get textbox control? Pin
Judah Gabriel Himango17-May-07 5:47
sponsorJudah Gabriel Himango17-May-07 5:47 
QuestionHelp needed to convert function to a generic function Pin
Jim Taylor17-May-07 3:11
Jim Taylor17-May-07 3:11 
AnswerRe: Help needed to convert function to a generic function Pin
Not Active17-May-07 4:12
mentorNot Active17-May-07 4:12 
GeneralRe: Help needed to convert function to a generic function Pin
Jim Taylor17-May-07 4:59
Jim Taylor17-May-07 4:59 
AnswerRe: Help needed to convert function to a generic function Pin
Judah Gabriel Himango17-May-07 5:11
sponsorJudah Gabriel Himango17-May-07 5:11 
GeneralRe: Help needed to convert function to a generic function Pin
Jim Taylor17-May-07 5:34
Jim Taylor17-May-07 5:34 
GeneralRe: Help needed to convert function to a generic function Pin
Not Active17-May-07 6:20
mentorNot Active17-May-07 6:20 
GeneralRe: Help needed to convert function to a generic function Pin
Judah Gabriel Himango17-May-07 7:15
sponsorJudah Gabriel Himango17-May-07 7:15 
AnswerRe: Help needed to convert function to a generic function Pin
Nissim Salomon20-May-07 0:19
Nissim Salomon20-May-07 0:19 
QuestionWhat are the Books on C#..?? Pin
IamPoojaa17-May-07 2:39
IamPoojaa17-May-07 2:39 
AnswerRe: What are the Books on C#..?? Pin
Sathesh Sakthivel17-May-07 2:51
Sathesh Sakthivel17-May-07 2:51 
GeneralRe: What are the Books on C#..?? Pin
IamPoojaa17-May-07 3:08
IamPoojaa17-May-07 3:08 
GeneralRe: What are the Books on C#..?? Pin
Sathesh Sakthivel17-May-07 3:12
Sathesh Sakthivel17-May-07 3:12 
AnswerRe: What are the Books on C#..?? Pin
Kevin McFarlane17-May-07 3:13
Kevin McFarlane17-May-07 3:13 
QuestionTAPI Multmedia transmission Pin
CallieClearence17-May-07 2:21
CallieClearence17-May-07 2:21 
QuestionDiff b/w Windows Control Library and Class Library Pin
Rahul8317-May-07 0:52
Rahul8317-May-07 0:52 
AnswerRe: Diff b/w Windows Control Library and Class Library Pin
Pete O'Hanlon17-May-07 1:54
mvePete O'Hanlon17-May-07 1:54 

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.