473,378 Members | 1,377 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Tab Questions

mat
Hi all,

If I have a main form with a TabControl and this method:

protected void NewTab()
{
TabPage newTab;
newTab = new TabPage();
newTab.BackColor = System.Drawing.SystemColors.Window;
newTab.Size = new System.Drawing.Size(498, 400);

RichTextBox richTextBox;
richTextBox = new PoccoRichTextBox();

newTab.Controls.Add(richTextBox);
tabControl.Controls.Add(newTab);
}

This adds a TabPage as I want, but then I find I am stuck not knowing
howto reference things.

How could I expand the above so that I can insert text into the textBox
and bring the tab to the front of the TabControl?

Your help would be great.

Mat
Nov 17 '05 #1
3 3254
Hi,

IIRC that code will give you error, you cannot add a TabPage to the Control
collection of the tabcontrol, you have to use TabPages

In order to select it do
tabcontrol.SelectedIndex = tabControl.TabPages.Count -1;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"mat" <yu********************@yahoo.co.uk> wrote in message
news:d4**********@newsg1.svr.pol.co.uk...
Hi all,

If I have a main form with a TabControl and this method:

protected void NewTab()
{
TabPage newTab;
newTab = new TabPage();
newTab.BackColor = System.Drawing.SystemColors.Window;
newTab.Size = new System.Drawing.Size(498, 400);

RichTextBox richTextBox;
richTextBox = new PoccoRichTextBox();

newTab.Controls.Add(richTextBox);
tabControl.Controls.Add(newTab);
}

This adds a TabPage as I want, but then I find I am stuck not knowing
howto reference things.

How could I expand the above so that I can insert text into the textBox
and bring the tab to the front of the TabControl?

Your help would be great.

Mat

Nov 17 '05 #2
Hi,

IIRC that code will give you error, you cannot add a TabPage to the Control
collection of the tabcontrol, you have to use TabPages

In order to select it do
tabcontrol.SelectedIndex = tabControl.TabPages.Count -1;
cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation


"mat" <yu********************@yahoo.co.uk> wrote in message
news:d4**********@newsg1.svr.pol.co.uk...
Hi all,

If I have a main form with a TabControl and this method:

protected void NewTab()
{
TabPage newTab;
newTab = new TabPage();
newTab.BackColor = System.Drawing.SystemColors.Window;
newTab.Size = new System.Drawing.Size(498, 400);

RichTextBox richTextBox;
richTextBox = new PoccoRichTextBox();

newTab.Controls.Add(richTextBox);
tabControl.Controls.Add(newTab);
}

This adds a TabPage as I want, but then I find I am stuck not knowing
howto reference things.

How could I expand the above so that I can insert text into the textBox
and bring the tab to the front of the TabControl?

Your help would be great.

Mat

Nov 17 '05 #3
mat
Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

IIRC that code will give you error, you cannot add a TabPage to the Control
collection of the tabcontrol, you have to use TabPages

In order to select it do
tabcontrol.SelectedIndex = tabControl.TabPages.Count -1;
cheers,

Hi Ignacio,

Thank you for your response. I found this useful:
tabcontrol.SelectedIndex = tabControl.TabPages.Count -1;


....but I didn't quite understand this:

you cannot add a TabPage to the Control collection of the tabcontrol,
you have to use TabPages?

It seems to work when I do it??

Mat
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: softwareengineer2006 | last post by:
All Interview Questions And Answers 10000 Interview Questions And Answers(C,C++,JAVA,DOTNET,Oracle,SAP) I have listed over 10000 interview questions asked in interview/placement test papers for...
0
by: connectrajesh | last post by:
INTERVIEWINFO.NET http://www.interviewinfo.net FREE WEB SITE AND SERVICE FOR JOB SEEKERS /FRESH GRADUATES NO ADVERTISEMENT
2
by: freepdfforjobs | last post by:
Full eBook with 4000 C#, JAVA,.NET and SQL Server Interview questions http://www.questpond.com/SampleInterviewQuestionBook.zip Download the JAVA , .NET and SQL Server interview sheet and rate...
4
by: Drew | last post by:
I posted this to the asp.db group, but it doesn't look like there is much activity on there, also I noticed that there are a bunch of posts on here pertaining to database and asp. Sorry for...
8
by: Krypto | last post by:
Hi, I have used Python for a couple of projects last year and I found it extremely useful. I could write two middle size projects in 2-3 months (part time). Right now I am a bit rusty and trying...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
1
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: ramu | last post by:
C# Interview Questions and Answers8 http://allinterviewsbooks.blogspot.com/2008/07/c-interview-questions-and-answers8.html C# Interview Questions and Answers7...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
0
by: reema | last post by:
EJB Interview Questions http://interviewdoor.com/technical/EJB-Interview-Questions.htm CSS Interview Questions http://interviewdoor.com/technical/CSS-Interview-Questions.htm C Interview Questions...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.