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

VB.NET Unable passing String value

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.

Nov 23 '05 #1
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.

Nov 23 '05 #2
frmParent.setValue("ddd",99.99)

this is the code I pass values :)

Nov 23 '05 #3

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

Similar topics

8
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer...
3
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) {...
4
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...
1
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...
0
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:...
12
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);
0
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,...
0
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...
3
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...
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?
1
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...
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,...
1
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
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,...
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.