O
o1j2m3
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.
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.