Question Form instance problem

prasad kulkarni

Well-known member
Joined
Sep 7, 2009
Messages
62
Programming Experience
1-3
hi friend,

I am using vb.net 2005 (window application). in form1 when I enter in textbox Listview is open , when i double click on particular record of listview
then these record show in form1. but form1 two instance is open but i want to show only one ie. new instance. how it is happen.
i am used objlistview.show() to display listwiew.
what is solution for these question, pl reply me soon
 
Hello.

I think you're doing this:
VB.NET:
Expand Collapse Copy
Dim temp As New Form1
temp.Show()
while you want to do this:
VB.NET:
Expand Collapse Copy
Form1.Show()

Bobby
 
When you open the 2nd form, pass it a reference to the first form:
VB.NET:
Expand Collapse Copy
.Show(Me)  or  .ShowDialog(Me)

Then on the 2nd form when you need to set, change or refresh anything on the first form from the 2nd form use the Owner property:
VB.NET:
Expand Collapse Copy
DirectCast(Me.Owner, Form1).Method/Property
It all depends on what you're doing so I can't make it any more specific right now
 
Back
Top