473,378 Members | 1,438 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.

Adding tab page to tab control dynamically - set focus ?

Rob
Hi,

I am adding Tab pages to a Tab control dynamically via the following
statement...

Form1.TabControl1.Controls.Add(ThePage)

The next 2 statements also work...

ThePage.Name = some string
ThePage.Text = some string

However....

When I want to make the newly added page the active page....

I have tried...

ThePage.Select()
and
ThePage.Focus()
and
ThePage.BringToFront()

None of these work...

Any Ideas ?
May 21 '07 #1
2 9950
On May 21, 11:09 am, "Rob" <r...@yahoo.comwrote:
Hi,

I am adding Tab pages to a Tab control dynamically via the following
statement...

Form1.TabControl1.Controls.Add(ThePage)

The next 2 statements also work...

ThePage.Name = some string
ThePage.Text = some string

However....

When I want to make the newly added page the active page....

I have tried...

ThePage.Select()
and
ThePage.Focus()
and
ThePage.BringToFront()

None of these work...

Any Ideas ?
Dim tp As New TabPage
tp.Text = "My TabPage"
Me.TabControl1.TabPages.Add(tp)
Me.TabControl1.SelectedTab = tp

Thanks,

Seth Rowe

May 21 '07 #2
Rob
Thanks, worked well !
"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@x35g2000prf.googlegr oups.com...
On May 21, 11:09 am, "Rob" <r...@yahoo.comwrote:
>Hi,

I am adding Tab pages to a Tab control dynamically via the following
statement...

Form1.TabControl1.Controls.Add(ThePage)

The next 2 statements also work...

ThePage.Name = some string
ThePage.Text = some string

However....

When I want to make the newly added page the active page....

I have tried...

ThePage.Select()
and
ThePage.Focus()
and
ThePage.BringToFront()

None of these work...

Any Ideas ?

Dim tp As New TabPage
tp.Text = "My TabPage"
Me.TabControl1.TabPages.Add(tp)
Me.TabControl1.SelectedTab = tp

Thanks,

Seth Rowe

May 21 '07 #3

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

Similar topics

5
by: Vinny Vin | last post by:
I would like to display a ToolTip (WinForms) when the Control associated recieves focus (when the control.enter event is triggered) as oppose to having the ToolTip displayed when the mouse hovers...
1
by: ravi sankar | last post by:
Hi, U need to use a placeholder control and add the control to the placeholder. http://aspnet.4guysfromrolla.com/articles/081402-1.aspx regards, s.ravi sankar >-----Original Message-----
0
by: David | last post by:
In ASP.NET 2.0, is it possible to use a control that's on a Master Page as a select parameter in a content page's datasource control? For example, the Master Page has a drop down list of...
3
by: David | last post by:
In ASP.NET 2.0, is it possible to use a control that's on a Master Page as a select parameter in a content page's datasource control? On the content page in the VWD Configure Data Source wizard...
5
by: Web Team | last post by:
Hi All, Can someone please explain how I go about adding a control (Say for example a panel) to a custom web control. I've tried this: Protected Overrides Sub Render(ByVal output As...
2
by: semesm22 | last post by:
i have a form that acts a layout for a movie theatre....i have created a user control to represent the seat...the problem is that i am dynamically creating about 200 of these seats at the page_load...
4
by: Jon Slaughter | last post by:
I've created some custom controls and forms that allow the feature to temporarily transfer focus to a control that has been entered by the mouse. Everything seems to work fine but the problem I...
3
by: Fritz Switzer | last post by:
I'm trying to AppendText to a TextEdit. I have a procedure that will go through the controls on a Windows form and return the control that has "focus". I have a number of TextEdits on my form...
3
by: StinkyDuck | last post by:
Is there a way to detect when a control gains focus on a webform? Say I have two text boxes. After the user types in information on the first text box and hits the tab key or clicks on the second...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.