473,473 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Public Properties for controls added at runtime ?

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
2 2813
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: John Grandy | last post by:
make a call to XML Web Service WebMethod ... returns object myArray with no error ... myArray contains objects of type StringKeyStringValue runtime error occurs on accessing properties of...
1
by: Rahim | last post by:
i want to change all the label control style Properties, server control properties at runtime how should i call all the label at runtime, which is present at webform, any collections???? i...
2
by: Eric | last post by:
I am in need of some advice on how to do the following: Have some type of container on form that would fill the visible area on screen (assuming the browser was maximized). I would like to...
0
by: anandv81 | last post by:
Hi, I encountered a strange problem while working on an application, the problem goes like this. I am generating a few textboxes at runtime at the server side and added to a placeholder, a...
6
by: | last post by:
I have made some user controls with custom properties. I can set those properties on instances of my user controls, and I have programmed my user control to do useful visual things in response to...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
9
by: J055 | last post by:
Hi I have a standard asp page which uses a MasterPage. The MasterPage contains a User control. How can I access a public method in the User control from my WebForm page? I can't move the method...
2
by: =?Utf-8?B?VG9u?= | last post by:
Hello, I want to understand teh benefits of ajax technology. Does anyone has a good website where AJAX EXTENSIONS is worked out so I really understand it. There a 2 main questions: 1) How about...
11
by: Web Search Store | last post by:
Hello, I set up a web page with 2 user controls. In classic asp, the first one did all the declarations, and the second one used the values, and could reset it. In ASP.Net so far I can't...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.