473,397 Members | 1,960 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,397 software developers and data experts.

Web Control

Hello,

How can I send a control to a class as a property?
I don't know which control it would be. It could be a panel, a label
....

Thanks,
Miguel

Dec 5 '06 #1
3 986
Miguel,

Just to clarify: Are you asking how to define a property in a class
that is a control? or how to assign a control to a property in a class
that has been defined as a control?

Kathryn
shapper wrote:
Hello,

How can I send a control to a class as a property?
I don't know which control it would be. It could be a panel, a label
...

Thanks,
Miguel
Dec 5 '06 #2
Hi,

I need to pass an object to a class which can represent a panel, a
label, or some other control. I did as follows:

Private _Control As Object
Public Property Control() As Object
Get
Return _Control
End Get
Set(ByVal value As Object)
_Control = value
End Set
End Property ' Control

Now, some how, inside my class, I need to add a literal control to this
control as a child.
Something like:

Me.Control.(Add Literal)

How can I do this?

Thanks,
Miguel

kbutterly wrote:
Miguel,

Just to clarify: Are you asking how to define a property in a class
that is a control? or how to assign a control to a property in a class
that has been defined as a control?

Kathryn
shapper wrote:
Hello,

How can I send a control to a class as a property?
I don't know which control it would be. It could be a panel, a label
...

Thanks,
Miguel
Dec 5 '06 #3
Miguel,

If you are sure that the property will be a control can you change the
Property definition to something more like this:

Public Property myControl() As Control
Get

End Get
Set(ByVal value As Control)

End Set
End Property

Using 'control' as a property name might be confusing....

So then after you add this control, you want to add a literal, so what
about something like this

Private _myControl As Control
Public Property myControl() As Control
Get
Return _myControl
End Get
Set(ByVal value As Control)
_myControl = value
End Set
End Property

Public Sub addLiteral()
Dim myLiteral As Literal
Me.myControl.Controls.Add(myLiteral)

End Sub

I'm a newbie, so I may be off the mark, but does this help?

Kathryn

shapper wrote:
Hi,

I need to pass an object to a class which can represent a panel, a
label, or some other control. I did as follows:

Private _Control As Object
Public Property Control() As Object
Get
Return _Control
End Get
Set(ByVal value As Object)
_Control = value
End Set
End Property ' Control

Now, some how, inside my class, I need to add a literal control to this
control as a child.
Something like:

Me.Control.(Add Literal)

How can I do this?

Thanks,
Miguel

kbutterly wrote:
Miguel,

Just to clarify: Are you asking how to define a property in a class
that is a control? or how to assign a control to a property in a class
that has been defined as a control?

Kathryn
shapper wrote:
Hello,
>
How can I send a control to a class as a property?
I don't know which control it would be. It could be a panel, a label
...
>
Thanks,
Miguel
Dec 5 '06 #4

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

Similar topics

6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
2
by: Mike | last post by:
Hi, I am strugling with a simple problem which I can't seem to resolve. I have an asp.net page which contains a server-control (flytreeview, which is a kind of a tree to be exact). The tree is...
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...
3
by: usha535140 | last post by:
Hi, Can we use Ajax RoundedCornersExtender control with AJax,tabContainer?
2
sanjib65
by: sanjib65 | last post by:
I try to create a custom control that will say, Hello + ComputerUserName. I have added in my App_Code folder a WelcomeLabel.cs file: // WelcomeLabel.cs using System; using...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.