By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,369 Members | 1,188 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,369 IT Pros & Developers. It's quick & easy.

Public Properties for controls added at runtime ?

P: n/a
Rob
I am not sure if this can be implemented....

There exists a TabContol (added at design time) to a form..

Tabs for this TabContol get added at run time.

Usage of the following 2 properties works quite welll in order to reference
the control.

Public Property TabControlAvailable() As TabControl
Get
Return Me.TabControl1
End Get
Set(ByVal value As TabControl)
Me.TabControl1 = value
End Set
End Property
Public Property SelectedTabAvailabe() As TabPage
Get
Return Me.TabControl1.SelectedTab
End Get
Set(ByVal value As TabPage)
Me.TabControl1.SelectedTab = value
End Set
End Property

However, there is also a Flow Layout Panel that also gets added to the Tab
page (dynamically) at runtime...

How may I access its properties ? Is it even possible ?

May 28 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On May 28, 10:14 am, "Rob" <r...@yahoo.comwrote:
I am not sure if this can be implemented....

There exists a TabContol (added at design time) to a form..

Tabs for this TabContol get added at run time.

Usage of the following 2 properties works quite welll in order to reference
the control.

Public Property TabControlAvailable() As TabControl
Get
Return Me.TabControl1
End Get
Set(ByVal value As TabControl)
Me.TabControl1 = value
End Set
End Property

Public Property SelectedTabAvailabe() As TabPage
Get
Return Me.TabControl1.SelectedTab
End Get
Set(ByVal value As TabPage)
Me.TabControl1.SelectedTab = value
End Set
End Property

However, there is also a Flow Layout Panel that also gets added to the Tab
page (dynamically) at runtime...

How may I access its properties ? Is it even possible ?
The easiest way would be to track the FlowLayoutPanel in a variable,
and then return that variable. The other thing (which might be easier)
is to loop through the tabpage's control's collection and return the
FlowLayoutPanel (by looking at each control's type and other
properties). Or, if you are using .Net 2.0 (VB 2005) and you assigned
a value to the FlowLayoutPanel's Name property, you can use the
FindControl method.

Thanks,

Seth Rowe

May 28 '07 #2

P: n/a
Rob
Seth,

The following code does return the correct name of the Flow Layout Panel
(which will always be unique)...

So now I would like to loop thru the FlowLayout Panel and obtain values of
some textbox fields that are held in the multiple User Defined Controls
within the Flow layout panel...

Is that possible ?

For Each ctlr As Control In
TimeCapture.Instance.SelectedTabAvailable.Controls
MsgBox(ctlr.Name)
Next

Also, I do not think FindControl is available.... This is not a web app...
(look like it resides in the System.Web.UI)

Thanks,
Rob

"rowe_newsgroups" <ro********@yahoo.comwrote in message
news:11**********************@q69g2000hsb.googlegr oups.com...
On May 28, 10:14 am, "Rob" <r...@yahoo.comwrote:
>I am not sure if this can be implemented....

There exists a TabContol (added at design time) to a form..

Tabs for this TabContol get added at run time.

Usage of the following 2 properties works quite welll in order to
reference
the control.

Public Property TabControlAvailable() As TabControl
Get
Return Me.TabControl1
End Get
Set(ByVal value As TabControl)
Me.TabControl1 = value
End Set
End Property

Public Property SelectedTabAvailabe() As TabPage
Get
Return Me.TabControl1.SelectedTab
End Get
Set(ByVal value As TabPage)
Me.TabControl1.SelectedTab = value
End Set
End Property

However, there is also a Flow Layout Panel that also gets added to the
Tab
page (dynamically) at runtime...

How may I access its properties ? Is it even possible ?

The easiest way would be to track the FlowLayoutPanel in a variable,
and then return that variable. The other thing (which might be easier)
is to loop through the tabpage's control's collection and return the
FlowLayoutPanel (by looking at each control's type and other
properties). Or, if you are using .Net 2.0 (VB 2005) and you assigned
a value to the FlowLayoutPanel's Name property, you can use the
FindControl method.

Thanks,

Seth Rowe

May 28 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.