473,406 Members | 2,867 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,406 software developers and data experts.

Object in Panel not realizing new values?

If i have a label that i add to a panel control collection in page
load.
then in another method i re instantiate the label and assign a
different text property, why doesn't the panel contain the new label
object

Nov 19 '05 #1
3 947
What you call to "re instantiate" actually means to create another instance
of Label class and assign it to the same pointer. Nothing happens to the old
instance, it is still referenced by another pointer that you put into a
control collection.

Eliyahu

<jw*****@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
If i have a label that i add to a panel control collection in page
load.
then in another method i the label and assign a
different text property, why doesn't the panel contain the new label
object

Nov 19 '05 #2
let me pub a code sample

protected objLabel as Label

sub page_load

objLabel = new Label
objlabel.text ="first text"
objpanel.controls.add(objLabel)
end sub

sub recreateControl
objLabel = new label
objLabel.text = "second text"
end sub

once the "recreateControl" method is called, should the "second text"
be displayed?

Nov 19 '05 #3
no. objpanel, still has a reference to the first one.

-- bruce (sqlwork.com)
<jw*****@gmail.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
let me pub a code sample

protected objLabel as Label

sub page_load

objLabel = new Label
objlabel.text ="first text"
objpanel.controls.add(objLabel)
end sub

sub recreateControl
objLabel = new label
objLabel.text = "second text"
end sub

once the "recreateControl" method is called, should the "second text"
be displayed?

Nov 19 '05 #4

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

Similar topics

7
by: Ryan Park | last post by:
Hi, //SITUATION I got a panel control that hold a certain position on a form. Every controls or UIs are on this panel. At certain situation, I called dispose() method of this panel control...
3
by: Fabrizio | last post by:
Hi, There is any chance to insert a control like a text box in a panel choosing the absolute position? When I try to insert a label , the panel positions the control on a locked position. Thanks...
0
by: Niraj via DotNetMonster.com | last post by:
i had put a panel in form and text box,label and numericupdown control in it. Now i had use to send the form as me to some function byref then again from that particular function i use to send the...
6
by: sklett | last post by:
I'm curious... asp:Panel renderes a <div> tag, right? And you can have text in a div tag.... so why not have a Text property for the asp:panel control??
4
by: dw | last post by:
Hello, all. I'm using a Panel to display the values the user entered into a form upon validation. The panel is mainPanel and its visibility is set to False server-side until the IsValid returns...
3
by: John Bailey | last post by:
I have a page with a business object that is populated by parsing input from the page (specifically a scanned drivers license). I was hoping that I could display the results using a details view...
0
by: MrNobody | last post by:
I have a custom Panel which will have smaller custom Panels added and drawn within it. I want to be able to re-order the arrangement of the inner Panels using drag n drop, and I want to do this...
6
by: kasper.rung | last post by:
I am having trouble implementing an interface. The interface requires a method to return an object, but it does not seem to be able to treat a reference type as an object. I have the following...
8
by: Mr. X. | last post by:
Hello. I have put 3 components on the form : Panel . dock property is left (left panel). Spliter. dock property is left. Panel. dock property is fill (right panel). I see that the spliter has...
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...
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...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...

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.