473,566 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.setVa lue("ddd",99.99 ) 'A values disappear once the B
closed
close()
end sub

private sub B_activated(... )
frmParent.setVa lue("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,A sPrice) in
A are correct; Once B is closed, the values(AsName,A sPrice) 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 3624
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.goo glegroups.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.setVa lue("ddd",99.99 ) 'A values disappear once the B
closed
close()
end sub

private sub B_activated(... )
frmParent.setVa lue("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,A sPrice) in
A are correct; Once B is closed, the values(AsName,A sPrice) 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.setVa lue("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
3950
by: Alex Vinokur | last post by:
Various forms of argument passing ================================= C/C++ Performance Tests ======================= Using C/C++ Program Perfometer http://sourceforge.net/projects/cpp-perfometer http://alexvn.freeservers.com/s1/perfometer.html
3
14916
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) { document.images.src = eval("mt" +menu+ ".src") } alert("imgOff_hidemenu"); hideMenu=setTimeout('Hide(menu,num)',500);
4
2547
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 can use comma separated values in design-time. The TypeConverter works great in design-time. It converts to and from just fine... However, when I try...
1
2317
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 Page." After a lot of googling, all i can find that this applies to is when trying to use enum-type datatypes as bit-vector flags, or when use...
0
800
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: ----------------------------------------------------------------------------------------------------------------- Unable to make the session state request to the session state server. Please ensure that the ASP.NET...
12
2669
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
1219
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, column 15: PLS-00306: wrong number or types of arguments in call to 'ADD_FILE' ORA-06550: line 1, column 7:
0
789
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 the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
3
14037
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 the software in your host machine. Stack Trace at System.Net.Sockets.NetworkStream.Write(Byte buffer, Int32 offset, Int32
0
7666
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8108
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7951
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2083
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 we have to send another system
1
1201
muto222
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.