Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Win API / December 2007



Tip: Looking for answers? Try searching our database.

How to track Different instance of same form ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
infiraghu@gmail.com - 06 Dec 2007 09:45 GMT
Dear Sir,

I want to track the form1 instance

My code is like :

Private Sub Command1_Click()
   Dim frm As New Form1
   frm.Show
End Sub

I am opening so many form instance and if i want to Change some
property of "Form1" then how to do it?

when i try like this it did not work:

Private Sub Command2_Click()
   Form1.txtname.text="GOOGLE"
End Sub

so please help me how can i asign the value of Form1.txtname

Thanks!
Raghu Bhandari
Ralph - 06 Dec 2007 13:54 GMT
> Dear Sir,
>
[quoted text clipped - 20 lines]
> Thanks!
> Raghu Bhandari

Create a Public Property in Form1
[Air code]
Public Property Let TxtName( txt As String )
   txtName.Text = txt
End Property

While not a major issue in this case, I strongly advise that you don't use
the "As New" construct. Use the following instead...

Dim frm As Form1
Set frm = New Form1
frm.TxtName = "GOOGLE"
frm.Show
Ken Halter - 06 Dec 2007 17:44 GMT
> Dear Sir,

When you post to multiple groups, one at a time, it's called Multiposting
and you create the possibility of someone overlooking the *fact* that there
are perfectly valid answers in another group. It's a waste of time for
everyone involved.

Instead of multiposting, Crosspost. That requires you to place the names of
all target groups in the "Newsgroups" field at once, separated by a
semi-colon. That makes sure that everyone trying to help you can see, and
possibly correct other answers, or just go to the next question and try to
help someone else. It saves you time because your question and all answers
will show in every group in your crosspost list. It's great for everyone
involved, including those looking for answers in the future.

Crosspost if you must, Multipost as an absolute last resort

Signature

Ken Halter - MS-MVP-VB - Please keep all discussions in the groups..
In Loving Memory - http://www.vbsight.com/Remembrance.htm

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.