I created 2 forms, A and B using VB.NET 2003
in A, the codes are :
==========================
public AsName as string
public AsPrice as double
public sub setValue(ByVal sname as string, ByVal price as double)
AsName = sname
AsPrice = price
end sub
private sub button0_click(...)
Dim frm as B
B.setParent(Me)
B.showDialog()
MsgBox(AsName) 'give me empty value, it should have value ***
MsgBox(AsPrice) 'give me empty value, it should have value ***
end sub
==========================
in B, the codes are :
==========================
public frmParent as A
public sub setParent(ByRef s as A)
frmParent = s
end sub
private sub button1_click(...)
frmParent.setValue("ddd",99.99) 'A values disappear once the B
closed
close()
end sub
private sub B_activated(...)
frmParent.setValue("ddd",99.99) 'A values maintained correct once
the B closed
close()
end sub
==========================
When I using F8 to trace... I found that, although the codes in
B_activated and button1_click are the same, but their behavior looks
different. B_activated provide me the correct output when I return to
A, but button1_click provide me wrong output.
During button1_click, when B is opening, the values(AsName,AsPrice) in
A are correct; Once B is closed, the values(AsName,AsPrice) in A will
automatic become empty and zero.
Anybody help? Because I need to pass the values within forms
frequently, but I have this problem? Any solution? Is this problem
solved in Service Pack already?
Urgent.. Thank You. 2 3617
Hi,
I have not had any problems passing values between forms.
Usually I add a public property to a form for passing a value. In your code
I do not see where you ever call setvalue to give asname and asprice a
value.
Ken
---------------
"o1j2m3" <o1****@hotmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com... I created 2 forms, A and B using VB.NET 2003
in A, the codes are : ========================== public AsName as string public AsPrice as double
public sub setValue(ByVal sname as string, ByVal price as double) AsName = sname AsPrice = price end sub
private sub button0_click(...) Dim frm as B B.setParent(Me) B.showDialog() MsgBox(AsName) 'give me empty value, it should have value *** MsgBox(AsPrice) 'give me empty value, it should have value *** end sub ==========================
in B, the codes are : ========================== public frmParent as A
public sub setParent(ByRef s as A) frmParent = s end sub
private sub button1_click(...) frmParent.setValue("ddd",99.99) 'A values disappear once the B closed close() end sub
private sub B_activated(...) frmParent.setValue("ddd",99.99) 'A values maintained correct once the B closed close() end sub ==========================
When I using F8 to trace... I found that, although the codes in B_activated and button1_click are the same, but their behavior looks different. B_activated provide me the correct output when I return to A, but button1_click provide me wrong output.
During button1_click, when B is opening, the values(AsName,AsPrice) in A are correct; Once B is closed, the values(AsName,AsPrice) in A will automatic become empty and zero.
Anybody help? Because I need to pass the values within forms frequently, but I have this problem? Any solution? Is this problem solved in Service Pack already?
Urgent.. Thank You.
frmParent.setValue("ddd",99.99)
this is the code I pass values :) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Alex Vinokur |
last post by:
Various forms of argument passing
=================================
C/C++ Performance Tests
=======================
Using C/C++ Program Perfometer...
|
by: domeceo |
last post by:
can anyone tell me why I cannot pass values in a setTimeout function
whenever I use this function it says "menu is undefined" after th
alert.
function imgOff(menu, num) {
if (document.images) {...
|
by: Chris Bower |
last post by:
Reposted from aspnet.buildingcontrols:
Ok, I've got a bunch of derived controls that all have a property Rights of
type Rights (Rights is an Enumerator). I wrote a custom TypeConverter so
that I...
|
by: A Traveler |
last post by:
Hello, i am having this problem. The exact error message is:
"Unable to generate code for a value of type 'System.Web.UI.Page'. This
error occurred while trying to generate the property value for...
|
by: Maciek |
last post by:
Hi
When I set Session state mode to StateServer (IIS 6.0; windows2003; .NET
2.0) in my application, I have recived this message:...
|
by: Andrew Bullock |
last post by:
Hi,
I have two classes, A and B,
B takes an A as an argument in its constructor:
A a1 = new A();
B b = new B(a1);
|
by: sjoshi |
last post by:
Hello All
I'm unable to use the ADD_FILE procedure from .NET. I can seem to get
others to work but I think I'm passing arguments incorrecty. The
message I get is:
Message: ORA-06550: line 1,...
|
by: Buddy Home |
last post by:
Hello,
I'm trying to upload a file programatically and occasionally I get the
following error message.
Unable to write data to the transport connection: An established connection
was aborted...
|
by: Buddy Home |
last post by:
Hello,
I'm trying to upload a file programatically and occasionally I get the
following error message.
Unable to write data to the transport connection: An established connection
was aborted...
|
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
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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,...
|
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...
|
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...
|
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: 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...
| |